Exemplo n.º 1
0
Arquivo: Game.cs Projeto: Amarinal/S3
        public void LoadFromFiles(String cardPath = null, String playersPath = null)
        {
            if (cardPath == null)
            {
                cardPath = @"Cartas.csv";
            }
            if (playersPath == null)
            {
                playersPath = @"Players.csv";
            }

            cards = new CardCollection();
            cards.ReadFromFile(cardPath);

            HelperCsv fichero = new HelperCsv(playersPath);
            Player    player;

            oponentes = new List <Player>();

            for (int i = 0; i < fichero.Count; i++)
            {
                player = new Player();
                player.LoadFromCsv(fichero, i, this.cards);
                oponentes.Add(player);
            }
        }
Exemplo n.º 2
0
Arquivo: Game.cs Projeto: Amarinal/S3
        public void LoadFromFiles(String cardPath = null, String playersPath = null)
        {
            if (cardPath == null) cardPath = @"Cartas.csv";
            if (playersPath == null) playersPath = @"Players.csv";

            cards = new CardCollection();
            cards.ReadFromFile(cardPath);

            HelperCsv fichero = new HelperCsv(playersPath);
            Player player;
            oponentes = new List<Player>();

            for (int i = 0; i < fichero.Count; i++)
            {
                player = new Player();
                player.LoadFromCsv(fichero, i, this.cards);
                oponentes.Add(player);
            }
        }