コード例 #1
0
 public Ship(
     LifeSpan lifeTime,
     PhysicsState physicsState,
     BodyFlags flags,
     RigidBodyTemplate template,
     ShipMovementInfo movementInfo,
     ShipState shipState,
     ControlableSounds controlableSounds,
     ShipSounds shipSounds,
     ActionList actions,
     IShip[] subShips)
     : base(
         lifeTime,
         physicsState,
         flags,
         template,
         movementInfo,
         shipState,
         controlableSounds)
 {
     this.UQMFlags       |= ContFlags.CanDoGravityWhip;
     this.shipSounds      = shipSounds;
     this.subShips        = subShips;
     this.actions         = actions;
     this.controlableType = ControlableType.Ship;
 }
コード例 #2
0
 public Ship(
     LifeSpan lifeTime,
     MassInertia massInfo,
     PhysicsState physicsState,
     BodyFlags flags,
     ICollidableBodyPart[] collidableParts,
     ShipMovementInfo movementInfo,
     ShipState shipState,
     ControlableSounds controlableSounds,
     ShipSounds shipSounds,
     ActionList actions,
     IShip[] subShips)
     : base(
         lifeTime,
         massInfo,
         physicsState,
         flags,
         collidableParts,
         movementInfo,
         shipState,
         controlableSounds)
 {
     this.UQMFlags       |= ContFlags.CanDoGravityWhip;
     this.shipSounds      = shipSounds;
     this.subShips        = subShips;
     this.actions         = actions;
     this.controlableType = ControlableType.Ship;
 }
コード例 #3
0
        void DelayedAddShip(object oship)
        {
            IShip oldShip = (IShip)oship;

            Thread.Sleep(VictorySongWait);
            ShipSounds Victor = null;

            if (Array.IndexOf <string>(SuicideShipNames, oldShip.GetType().Name) != -1)
            {
                Victor = oldShip.ShipSounds;
            }
            foreach (IShip ship in GetShips())
            {
                if (!ship.IsExpired)
                {
                    if ((ship.FactionInfo.FactionCollection.GetDiplomacy(ship.FactionInfo, oldShip.FactionInfo) & FactionDiplomacy.Enemy) == FactionDiplomacy.Enemy)
                    {
                        Victor = ship.ShipSounds;
                        break;
                    }
                }
            }
            if (Victor != null)
            {
                Victor.Victory.Play();
            }
            Thread.Sleep(DeathWait - VictorySongWait);
            lock (world)
            {
                ReMasterSDL.physicsTimer.Enabled = false;

                lock (syncroot)
                {
                    GameResult gameResult = new GameResult();
                    IShip      newShip    = GetNewShip(oldShip.FactionInfo);
                    //IShip newShip2 = (IShip)newShip.Clone();
                    newShip.AddControler(null, oldShip.Controlers[0]);
                    if (oldShip.Controlers.Length > 1)
                    {
                        newShip.AddControler(null, oldShip.Controlers[1]);
                    }
                    AddShip(gameResult, newShip, oldShip.FactionInfo);
                    world.HandleActionEvents(gameResult);
                }
            }
            BindWorld(CamerasLastPosition);

            MeleeMusic.PlayDefault();
            Thread.Sleep(AfterChoiceWait);
            ReMasterSDL.physicsTimer.Enabled = true;
        }
コード例 #4
0
 protected Ship(Ship copy)
     : base(copy)
 {
     this.shipSounds = copy.shipSounds;
     this.actions    = new ActionList(copy.actions);
     if (copy.subShips != null)
     {
         int length = copy.subShips.Length;
         this.subShips = new IShip[length];
         for (int pos = 0; pos < length; ++pos)
         {
             this.subShips[pos] = (IShip)copy.subShips[pos].Clone();
         }
     }
     this.aIInfo    = Functions.Clone <IShipAIInfo>(copy.aIInfo);
     this.spawnInfo = copy.spawnInfo;
 }