Пример #1
0
 public static void Appdate_cur_master(Tavern_master master)
 {
     cur_master         = master;
     cur_player_name    = cur_master.Get_Name();
     file_of_population = @"\" + cur_player_name + "pulation.dat";
     file_of_counter    = @"\" + cur_player_name + "counter.dat";
 }
Пример #2
0
        public bool Equals(Tavern_master human)
        {
            if (Object.ReferenceEquals(null, human))
            {
                return(false);
            }
            if (Object.ReferenceEquals(this, human))
            {
                return(true);
            }

            return(IsEqual(human));
        }
Пример #3
0
        static public Tuple <Tavern_master, List <Tavern_master> > Get_masters(string filename)//Чтение игроков из файла
        {
            BinaryFormatter      formatter   = new BinaryFormatter();
            Tavern_master        cur_master  = new Tavern_master();
            List <Tavern_master> all_masters = new List <Tavern_master>();
            Tuple <Tavern_master, List <Tavern_master> > masters = new Tuple <Tavern_master, List <Tavern_master> >(cur_master, all_masters);

            using (FileStream filestream = new FileStream(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
                                                          + @"\Tavern_master" + filename, FileMode.OpenOrCreate))
            {
                Tuple <Tavern_master, List <Tavern_master> > masterr = (Tuple <Tavern_master, List <Tavern_master> >)formatter.Deserialize(filestream);
                masters = masterr;
            }
            return(masters);
        }
Пример #4
0
 bool IsEqual(Tavern_master human)
 {
     return(String.Equals(Name, human.Name));
 }
Пример #5
0
 public static void AddMaster(Tavern_master master)
 {
     Masters.Add(master);
 }