예제 #1
0
        public void Setup()
        {
            _somePlayers = new List<Player> {
                new Player(20, 1, Color.Pink) { RechargeLevel = 3, CapacityLevel = 1, Name = "Pete" },
                new Player(20, 1, Color.Orange) { IsDead = true, NumberOfNukes = 99, Name = "Little Pete" },
            };

            _someShipList = new ShipList {
                Ships = new List<Ship> {
                    new Ship { PositionX = 47.06f, VelocityX = -2.05f },
                    new Ship { IsDead = true, VelocityY = 0.009f },
                }
            };
            _someBullets = new List<Bullet> {
                new Bullet(_somePlayers[0], 23.5f),
                new Bullet(_somePlayers[1], 45.0f),
            };
            _someShockwaves = new List<Shockwave> {
                new Shockwave(55, 56, 57, _somePlayers[1]),
                new Shockwave(22, 23, 42, _somePlayers[0]),
            };
            _aPoint = new Point(100, 200);
        }
예제 #2
0
 private ShipList GetShipListFromPlayers(IEnumerable<Player> players)
 {
     ShipList shipList = new ShipList { Ships = new List<Ship>() };
     var ships = shipList.Ships;
     foreach(Player player in players)
     {
         ships.Add( new Ship {
             OwnerName = player.Name,
             IsDead 	  = player.ClientIsDead,
             Energy    = player.Energy,
             PositionX = player.PositionX,
             PositionY = player.PositionY,
             VelocityX = player.VelocityX,
             VelocityY = player.VelocityY,
             Angle     = player.Angle
         });
     }
     return shipList;
 }