Ejemplo n.º 1
0
		public void applyConfig()
		{
			if (System.IO.File.Exists ("Savestate.xml") && (System.IO.File.GetLastWriteTime("Savestate.xml") > dt))
			{
				dt = System.IO.File.GetLastWriteTime ("Savestate.xml");
				State state = new State ();
				state.loadFromXML ();
				board = new Board ((char[][])state.board.Clone ());
				players = new List<Player> (state.players);
				turn = state.playerturn;
			}
		}
Ejemplo n.º 2
0
		public void Update()
		{
			if (gamePlaying)
			{
				ctrl.applyConfig ();
				int results = playerList [plIndex].Play (ui);
				if (results == 1)
				{
					if (ui.GetController().GameEnd())
					{
						gamePlaying = false;	
						System.IO.File.Delete ("Savestate.xml");
					} 
					else
					{
						plIndex = (plIndex + 1) % playerList.Count;
						State state = new State ();
						state.getState (ctrl);
						state.saveToXML ();
					}
				}
			}
		}