protected void InitializeLocation() { Path smallgarden_path = new Path(new String[] { "smallgarden", "smallcloset", "South", "North" }, null, "You go through a door2.", new Direction[] { Iteration78.Direction.South, Iteration78.Direction.North }); Location smallgarden = new Location(new String[] { "small garden" }, "smallgarden", "There are many small shrubs and flowers growing from well tended garden beds.", smallgarden_path); Path smallcloset_path = new Path(new String[] { "smallcloset", "hallway", "East", "North" }, smallgarden, "You travel through a small door, and then crawl a few meters before " + "arriving from the north", new Direction[] { Iteration78.Direction.East, Iteration78.Direction.North }); Location smallcloset = new Location(new String[] { "small closet" }, "smallcloset", "A small dark closet, with an odd smell", smallcloset_path); Path hallway_path = new Path(new String[] { "hallway", "South", }, smallcloset, "You go through a door.", new Direction[] { Iteration78.Direction.South }); Location hallway = new Location(new String[] { "hallway", "long hallway" }, "hallway", "This is a long well lit hallway", hallway_path); List <Location> locationlist = new List <Location>(); locationlist.Add(hallway); locationlist.Add(smallcloset); locationlist.Add(smallgarden); _defaultLocation = hallway; _locationlist = locationlist; Iteration78.Item shovel = new Iteration78.Item(new String[] { "shovel", "cool shovel" }, "a shovel", "This is a shovel ..."); Iteration78.Item sword = new Iteration78.Item(new String[] { "sword", "short sword" }, "a sword", "This is a short sword ..."); Iteration78.Item shield = new Iteration78.Item(new String[] { "shield", "rusty shield" }, "a shield", "This is a shield"); hallway.Inventory.Put(shield); smallcloset.Inventory.Put(shovel); smallgarden.Inventory.Put(sword); }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); InitializeLocation(); commandText.Hide(); descText.Hide(); _player = new Player("me", "", _defaultLocation, _locationlist); Iteration78.Item shovel = new Iteration78.Item(new String[] { "shovel", "cool shovel" }, "a shovel", "This is a shovel ..."); Iteration78.Item sword = new Iteration78.Item(new String[] { "sword", "short sword" }, "a sword", "This is a short sword ..."); Iteration78.Item paper = new Iteration78.Item(new String[] { "paper" }, "a paper", "This is a white paper ..."); _player.Inventory.Put(shovel); _player.Inventory.Put(sword); Bag bag = new Bag(new String[] { "bag" }, "leather bag", "This is my bag."); _player.Inventory.Put(bag); bag.Inventory.Put(paper); TextArea.Buffer.Text = "What's your name?"; CommandButton.Clicked += GetInfo; }