UnitAiMoonGuard::UnitAiMoonGuard(const AiShipReference& ship,
                                 const WorldInterface& world,
                                 const PhysicsObjectId& id_moon)
    : UnitAiSuperclass(ship), m_id_target(PhysicsObjectId::ID_NOTHING),
      m_steering_behaviour(ship.getId()), m_scan_counter(0),
      m_moon_id(id_moon), mp_world(&world)
{
    assert(ship.isShip());
    assert(id_moon.m_type == PhysicsObjectId::TYPE_PLANETOID);
    assert(world.isAlive(id_moon));
    assert(world.isPlanetoidMoon(id_moon));
}
示例#2
0
UnitAiMoonGuard :: UnitAiMoonGuard (const AiShipReference& ship,
                                    const WorldInterface& world,
                                    const PhysicsObjectId& id_moon)
    : UnitAiSuperclass(ship)
{
    assert(ship.isShip());
    assert(id_moon.m_type == PhysicsObjectId::TYPE_PLANETOID);
    assert(world.isAlive(id_moon));
    assert(world.isPlanetoidMoon(id_moon));

    steeringBehaviour = new FleetName::SteeringBehaviour(ship.getId());
    moon = id_moon;
    scanCount = rand() % SCAN_COUNT_MAX;

}