public SquareVisitedState visited_state; //Using a string to store one of three values: last move, unexplored, explored public BaseSquare() { bender_present = false; beer_can_present = false; visited_state = SquareVisitedState.unexplored(); //Deafult units_present = new Dictionary <Unit, bool>(); }
static Backgrounds() { last_move_bitmap = Properties.Resources.background_last_move; explored_bitmap = Properties.Resources.background_explored; unexplored_bitmap = Properties.Resources.background_unexplored; dictionary = new Dictionary <SquareVisitedState, System.Drawing.Bitmap>(); dictionary.Add(SquareVisitedState.last(), last_move_bitmap); dictionary.Add(SquareVisitedState.explored(), explored_bitmap); dictionary.Add(SquareVisitedState.unexplored(), unexplored_bitmap); }
//Only called when we start a new episode //We need to reset the visited state as well public void shuffle_cans_and_bender() { //Activate the 50/50 chance for each tile to have beer in it. foreach (var i in board_data) { foreach (var j in i) { ((BoardSquare)j).randomize_beer_presence(); ((BoardSquare)j).visited_state = SquareVisitedState.unexplored(); } } shuffle_bender(); //Place bender randomly somewhere //get_square_unit_is_on().visited_state = SquareVisitedState.last(); }
//This is called when the algorithm has been reset public void ClearCans() { //Clear all cans foreach (var i in board_data) { foreach (var j in i) { j.beer_can_present = false; if (j.bender_present) { j.visited_state = SquareVisitedState.last(); } else { j.visited_state = SquareVisitedState.unexplored(); } } } }