home *** CD-ROM | disk | FTP | other *** search
- using System;
- using System.Drawing;
- using System.Collections;
- using System.ComponentModel;
- using System.Windows.Forms;
- using System.Data;
-
- namespace wombat
- {
- /*
- * TO DO:
- *
- */
-
- /// <summary>
- /// Summary description for Form1.
- /// </summary>
- public class MainForm : System.Windows.Forms.Form
- {
- private System.Windows.Forms.Panel panel1;
- private System.Windows.Forms.TextBox inputTB;
- private System.Windows.Forms.TextBox displayTB;
- private System.Windows.Forms.Button takeBtn;
- private System.Windows.Forms.Button dropBtn;
- private System.Windows.Forms.Button lookBtn;
- private System.Windows.Forms.Button northBtn;
- private System.Windows.Forms.Button westBtn;
- private System.Windows.Forms.Button southBtn;
- private System.Windows.Forms.Button eastBtn;
- private System.Windows.Forms.Button testBtn;
- private System.Windows.Forms.Button testBtn2;
- /// <summary>
- /// Required designer variable.
- /// </summary>
- private System.ComponentModel.Container components = null;
-
- public MainForm()
- {
- //
- // Required for Windows Form Designer support
- //
- InitializeComponent();
-
- //
- // TODO: Add any constructor code after InitializeComponent call
- //
- }
-
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- protected override void Dispose( bool disposing )
- {
- if( disposing )
- {
- if (components != null)
- {
- components.Dispose();
- }
- }
- base.Dispose( disposing );
- }
-
- #region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- private void InitializeComponent()
- {
- this.displayTB = new System.Windows.Forms.TextBox();
- this.panel1 = new System.Windows.Forms.Panel();
- this.testBtn2 = new System.Windows.Forms.Button();
- this.testBtn = new System.Windows.Forms.Button();
- this.southBtn = new System.Windows.Forms.Button();
- this.eastBtn = new System.Windows.Forms.Button();
- this.westBtn = new System.Windows.Forms.Button();
- this.northBtn = new System.Windows.Forms.Button();
- this.lookBtn = new System.Windows.Forms.Button();
- this.dropBtn = new System.Windows.Forms.Button();
- this.takeBtn = new System.Windows.Forms.Button();
- this.inputTB = new System.Windows.Forms.TextBox();
- this.panel1.SuspendLayout();
- this.SuspendLayout();
- //
- // displayTB
- //
- this.displayTB.Dock = System.Windows.Forms.DockStyle.Top;
- this.displayTB.Multiline = true;
- this.displayTB.Name = "displayTB";
- this.displayTB.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
- this.displayTB.Size = new System.Drawing.Size(512, 232);
- this.displayTB.TabIndex = 0;
- this.displayTB.Text = "";
- //
- // panel1
- //
- this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
- this.panel1.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.testBtn2,
- this.testBtn,
- this.southBtn,
- this.eastBtn,
- this.westBtn,
- this.northBtn,
- this.lookBtn,
- this.dropBtn,
- this.takeBtn,
- this.inputTB});
- this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.panel1.Location = new System.Drawing.Point(0, 232);
- this.panel1.Name = "panel1";
- this.panel1.Size = new System.Drawing.Size(512, 125);
- this.panel1.TabIndex = 1;
- //
- // testBtn2
- //
- this.testBtn2.Location = new System.Drawing.Point(232, 80);
- this.testBtn2.Name = "testBtn2";
- this.testBtn2.TabIndex = 9;
- this.testBtn2.Text = "Test 2";
- this.testBtn2.Click += new System.EventHandler(this.testBtn2_Click);
- //
- // testBtn
- //
- this.testBtn.Location = new System.Drawing.Point(232, 40);
- this.testBtn.Name = "testBtn";
- this.testBtn.TabIndex = 8;
- this.testBtn.Text = "Test";
- this.testBtn.Click += new System.EventHandler(this.testBtn_Click);
- //
- // southBtn
- //
- this.southBtn.Location = new System.Drawing.Point(384, 80);
- this.southBtn.Name = "southBtn";
- this.southBtn.Size = new System.Drawing.Size(48, 24);
- this.southBtn.TabIndex = 7;
- this.southBtn.Text = "S";
- //
- // eastBtn
- //
- this.eastBtn.Location = new System.Drawing.Point(416, 48);
- this.eastBtn.Name = "eastBtn";
- this.eastBtn.Size = new System.Drawing.Size(48, 24);
- this.eastBtn.TabIndex = 6;
- this.eastBtn.Text = "E";
- //
- // westBtn
- //
- this.westBtn.Location = new System.Drawing.Point(352, 48);
- this.westBtn.Name = "westBtn";
- this.westBtn.Size = new System.Drawing.Size(48, 24);
- this.westBtn.TabIndex = 5;
- this.westBtn.Text = "W";
- //
- // northBtn
- //
- this.northBtn.Location = new System.Drawing.Point(384, 16);
- this.northBtn.Name = "northBtn";
- this.northBtn.Size = new System.Drawing.Size(48, 24);
- this.northBtn.TabIndex = 4;
- this.northBtn.Text = "N";
- this.northBtn.Click += new System.EventHandler(this.northBtn_Click);
- //
- // lookBtn
- //
- this.lookBtn.Location = new System.Drawing.Point(16, 88);
- this.lookBtn.Name = "lookBtn";
- this.lookBtn.TabIndex = 3;
- this.lookBtn.Text = "Look";
- //
- // dropBtn
- //
- this.dropBtn.Location = new System.Drawing.Point(112, 40);
- this.dropBtn.Name = "dropBtn";
- this.dropBtn.TabIndex = 2;
- this.dropBtn.Text = "Drop";
- //
- // takeBtn
- //
- this.takeBtn.Location = new System.Drawing.Point(16, 40);
- this.takeBtn.Name = "takeBtn";
- this.takeBtn.TabIndex = 1;
- this.takeBtn.Text = "Take";
- //
- // inputTB
- //
- this.inputTB.Location = new System.Drawing.Point(16, 8);
- this.inputTB.Name = "inputTB";
- this.inputTB.Size = new System.Drawing.Size(176, 20);
- this.inputTB.TabIndex = 0;
- this.inputTB.Text = "";
- //
- // MainForm
- //
- this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
- this.ClientSize = new System.Drawing.Size(512, 357);
- this.Controls.AddRange(new System.Windows.Forms.Control[] {
- this.panel1,
- this.displayTB});
- this.Name = "MainForm";
- this.Text = "Form1";
- this.panel1.ResumeLayout(false);
- this.ResumeLayout(false);
-
- }
- #endregion
-
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void Main()
- {
- Application.Run(new MainForm());
- }
-
-
-
- private void testBtn_Click(object sender, System.EventArgs e)
- {
- Adventure adv = new Adventure();
-
- // display all rooms and contents in the map
- displayTB.Text = adv.Map.describe();
-
- // just for testing, also describe the player
- displayTB.AppendText(adv.Player.Name);
- displayTB.AppendText(" are currently in this room ->");
- displayTB.AppendText(adv.Player.CurrentRoom.describe());
- }
-
- private void testBtn2_Click(object sender, System.EventArgs e)
- {
- /*
- Nothing to test at the moment!
- */
-
- }
-
- private void northBtn_Click(object sender, System.EventArgs e)
- {
- // yet to be implemented
- }
-
-
- }
- }
-