コード例 #1
0
ファイル: ABonus.cs プロジェクト: znsoft/AiCup
 public ABonus(Bonus bonus)
 {
     Type = bonus.Type;
     X = bonus.X;
     Y = bonus.Y;
     Width = bonus.Width;
     Height = bonus.Height;
     Id = bonus.Id;
 }
コード例 #2
0
        public World(int tick, int tickCount, int lastTickIndex, int width, int height, Player[] players, Car[] cars,
                Projectile[] projectiles, Bonus[] bonuses, OilSlick[] oilSlicks, string mapName, TileType[][] tilesXY,
                int[][] waypoints, Direction startingDirection)
        {
            this.tick = tick;
            this.tickCount = tickCount;
            this.lastTickIndex = lastTickIndex;
            this.width = width;
            this.height = height;

            this.players = new Player[players.Length];
            Array.Copy(players, this.players, players.Length);

            this.cars = new Car[cars.Length];
            Array.Copy(cars, this.cars, cars.Length);

            this.projectiles = new Projectile[projectiles.Length];
            Array.Copy(projectiles, this.projectiles, projectiles.Length);

            this.bonuses = new Bonus[bonuses.Length];
            Array.Copy(bonuses, this.bonuses, bonuses.Length);

            this.oilSlicks = new OilSlick[oilSlicks.Length];
            Array.Copy(oilSlicks, this.oilSlicks, oilSlicks.Length);

            this.mapName = mapName;

            this.tilesXY = new TileType[tilesXY.Length][];
            for (int i = tilesXY.Length - 1; i >= 0; --i) {
                this.tilesXY[i] = new TileType[tilesXY[i].Length];
                Array.Copy(tilesXY[i], this.tilesXY[i], tilesXY[i].Length);
            }

            this.waypoints = new int[waypoints.Length][];
            for (int i = waypoints.Length - 1; i >= 0; --i) {
                this.waypoints[i] = new int[waypoints[i].Length];
                Array.Copy(waypoints[i], this.waypoints[i], waypoints[i].Length);
            }

            this.startingDirection = startingDirection;
        }