Пример #1
0
        static public List <Card> MakeCards(string FileName, List <Card> MyList, string CardType)
        {
            FileStream file = new FileStream(FileName, FileMode.OpenOrCreate);

            file.Close();//never forget to close the stream
            string[] CardAtributs = File.ReadAllText(FileName).Split('\n');
            switch (CardType.ToLower())
            {
            case "blue":
                for (int i = 0; i < CardAtributs.Length; i += 3)    //3 reprosents the the number of card atributs that are being asined
                {
                    Card a = new Blue(i, CardAtributs);
                }
                return(Blue.blueCards);

            default:
                Exception prob = new Exception("this type of card does not exist");
                throw prob;
            }
        }