Exemple #1
0
        public TGame([CallerFilePath] string filePath = null)
        {
            var path = Path.GetDirectoryName(filePath) + "/bin/debug";

            var files = Directory.GetFiles(path + "/Tiles", "*.bmp");

            foreach (var file in files)
            {
                TileImages.Add(readGraphics(file));
            }
            files = Directory.GetFiles(path + "/Resources", "*.bmp");
            foreach (var file in files)
            {
                ResImages.Add(readGraphics(file));
            }
            files = Directory.GetFiles(path + "/Artifacts", "*.bmp");
            foreach (var file in files)
            {
                ArtifactImages.Add(readGraphics(file));
            }

            Map = new Bitmap(path + "/map.bmp");

            Reset();

            for (int i = 0; i < MaxPlayersCount; i++)
            {
                var player = new TPlayer(this);
                player.ColorId = PlayersColors[i];
                Players.Add(player);
            }
            ActivePlayer = Players[MaxPlayersCount - 1];
            NextTurn();
        }
Exemple #2
0
 public void NextTurn()
 {
     ActivePlayer = Players[(Players.IndexOf(ActivePlayer) + 1) % Players.Count];
     ActiveHero   = ActivePlayer.Heroes[0];
 }