Example #1
0
        // Method to open/shut door.
        public void OpenShut(MainForm mf)
        {
            if (this.open == false)
            {
                this.open = true;
                switch(this.wallLocation){
                    case Direction.North: this.imageRefSideA = "door_n_open"; break;
                    case Direction.East: this.imageRefSideA = "door_e_open"; break;
                    case Direction.South: this.imageRefSideA = "door_s_open"; break;
                    case Direction.West: this.imageRefSideA = "door_w_open"; break;
                }
                // Update Rooms and Occupants that are now visible.
                foreach(Room room in makesVisible){
                    room.visible = true;
                    foreach(Character affectMe in room.occupants){
                        mf.visibleBaddies.Add(affectMe);
                        mf.remainingBaddies.Remove(affectMe);
                    }
                }

            } else
            {
                this.open = false;
                switch(this.wallLocation){
                    case Direction.North: this.imageRefSideA = "door_n_closed"; break;
                    case Direction.East: this.imageRefSideA = "door_e_closed"; break;
                    case Direction.South: this.imageRefSideA = "door_s_closed"; break;
                    case Direction.West: this.imageRefSideA = "door_w_closed"; break;
                }
            }
        }
Example #2
0
 private static void Main(string[] args)
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     // Following line is to enable access to MainForm variables from other classes.
     MainForm mf = new MainForm();
     Application.Run(mf);
 }