| 1376 | } |
| 1377 | |
| 1378 | Maybe<Vec2F> WorldEntityCallbacks::entityVelocity(World* world, EntityId entityId) { |
| 1379 | auto entity = world->entity(entityId); |
| 1380 | |
| 1381 | if (auto monsterEntity = as<Monster>(entity)) |
| 1382 | return monsterEntity->velocity(); |
| 1383 | else if (auto npcEntity = as<Npc>(entity)) |
| 1384 | return npcEntity->velocity(); |
| 1385 | else if (auto playerEntity = as<Player>(entity)) |
| 1386 | return playerEntity->velocity(); |
| 1387 | else if (auto vehicleEntity = as<Vehicle>(entity)) |
| 1388 | return vehicleEntity->velocity(); |
| 1389 | else if (auto projectileEntity = as<Projectile>(entity)) |
| 1390 | return projectileEntity->velocity(); |
| 1391 | |
| 1392 | return {}; |
| 1393 | } |
| 1394 | |
| 1395 | Maybe<uint64_t> WorldEntityCallbacks::entityCurrency(World* world, EntityId entityId, String const& currencyType) { |
| 1396 | if (auto player = world->get<Player>(entityId)) { |