Esempio n. 1
0
 private Proxy()
 {
     Manager = LayoutManager.GetManager();
     IsLocked = false;
     _game = Game.Instance();
     _drawer = Drawer.Instance();
     _keyController = new KeyController();
 }
Esempio n. 2
0
        public void SaveGame(Game game)
        {
            _state = new GameState(game.Map, game.Players, game.Players.IndexOf(game.CurrentPlayer));

            try
            {
                using (Stream stream = File.Open("test.bin", FileMode.Create))
                {
                    var bin = new BinaryFormatter();
                    bin.Serialize(stream, _state);
                }
            }
            catch (IOException)
            {
                MessageBox.Show("Error while saving to file!");
            }
        }
Esempio n. 3
0
 public static Game Instance()
 {
     return _instance ?? (_instance = new Game());
 }