Beispiel #1
0
        private void responseType_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (Response.SelectedIndex == -1 || Value.SelectedIndex == -1 || Properties.SelectedIndex == -1)
            {
                MessageBox.Show(this, "You need to select a property, a value and a response first.");
                return;
            }
            ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex];
            ObjValue    val  = (ObjValue)prop.Values[Value.SelectedIndex];
            ObjResponse resp = (ObjResponse)val.Responses[Response.SelectedIndex];
            Opcode      code = (Opcode)responseType.SelectedIndex;

            resp.Operation = code;
            switch (code)
            {
            case Opcode.none:
                argument1.Visible = false;
                argument2.Visible = false;
                break;

            case Opcode.textout:
            case Opcode.increment:
                argument1.Visible = true;
                argument2.Visible = false;
                if (resp.Arguments.Count < 1)
                {
                    resp.Arguments.Add("");
                }
                argument1.Text = (string)resp.Arguments[0];
                break;
            }
        }
Beispiel #2
0
        private void button_value_Click(object sender, System.EventArgs e)
        {
            if (textbox_add.Text.Length == 0)
            {
                return;
            }
            if (Properties.SelectedIndex == -1)
            {
                MessageBox.Show(this, "You need to select a property first.");
                return;
            }
            int x = 0;

            try
            {
                x = System.Convert.ToInt32(textbox_add.Text);
            }
            catch (System.FormatException)
            {
                MessageBox.Show(this, "You must enter a numeric value");
                return;
            }
            ObjValue    val  = new ObjValue(x);
            ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex];

            prop.Values.Add(val);
            Value.Items.Add(val.Value);
        }
Beispiel #3
0
 private void getValuesFromNode()
 {
     ObjectName.Text = m_node.Name;
     m_properties    = m_node.Properties;
     foreach (ObjProperty prop in m_properties)
     {
         Properties.Items.Add(prop.Name);
     }
     if (m_properties.Count > 0)
     {
         ObjProperty prop = (ObjProperty)m_properties[0];
         foreach (ObjValue val in prop.Values)
         {
             Value.Items.Add(val.Value);
         }
         if (prop.Values.Count > 0)
         {
             ObjValue val = (ObjValue)prop.Values[0];
             foreach (ObjResponse resp in val.Responses)
             {
                 Response.Items.Add(resp.Name);
             }
         }
     }
 }
Beispiel #4
0
        private void argument1_TextChanged(object sender, System.EventArgs e)
        {
            ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex];
            ObjValue    val  = (ObjValue)prop.Values[Value.SelectedIndex];
            ObjResponse resp = (ObjResponse)val.Responses[Response.SelectedIndex];

            resp.Arguments[0] = argument1.Text;
        }
Beispiel #5
0
        private void button_property_Click(object sender, System.EventArgs e)
        {
            if (textbox_add.Text.Length == 0)
            {
                return;
            }
            ObjProperty prop = new ObjProperty(textbox_add.Text);

            m_properties.Add(prop);
            Properties.Items.Add(prop.Name);
        }
Beispiel #6
0
        private void Properties_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex];

            Response.Items.Clear();
            Value.Items.Clear();
            foreach (ObjValue val in prop.Values)
            {
                Value.Items.Add(val.Value);
            }
        }
Beispiel #7
0
        private void Response_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (Response.SelectedIndex == -1 || Value.SelectedIndex == -1)
            {
                MessageBox.Show(this, "You need to select a property and a value first.");
                return;
            }
            ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex];
            ObjValue    val  = (ObjValue)prop.Values[Value.SelectedIndex];
            ObjResponse resp = (ObjResponse)val.Responses[Response.SelectedIndex];

            responseType.SelectedIndex = (int)resp.Operation;
            argument1.Text             = (string)resp.Arguments[0];
            argument2.Text             = (string)resp.Arguments[1];
        }
Beispiel #8
0
        private void Value_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            if (Properties.SelectedIndex == -1)
            {
                MessageBox.Show(this, "You need to select a property first.");
                return;
            }
            ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex];
            ObjValue    val  = (ObjValue)prop.Values[Value.SelectedIndex];

            Response.Items.Clear();
            foreach (ObjResponse resp in val.Responses)
            {
                Response.Items.Add(resp.Name);
            }
        }
Beispiel #9
0
        private void button_response_edit_Click(object sender, System.EventArgs e)
        {
            if (textbox_add.Text.Length == 0)
            {
                return;
            }
            if (Response.SelectedIndex == -1 || Value.SelectedIndex == -1 || Properties.SelectedIndex == -1)
            {
                MessageBox.Show(this, "You need to select a property, a value and a response first.");
                return;
            }
            ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex];
            ObjValue    val  = (ObjValue)prop.Values[Value.SelectedIndex];
            ObjResponse resp = (ObjResponse)val.Responses[Response.SelectedIndex];

            resp.Name = textbox_add.Text;
            Response.Items[Response.SelectedIndex] = textbox_add.Text;
        }
Beispiel #10
0
        private void button_response_Click(object sender, System.EventArgs e)
        {
            if (textbox_add.Text.Length == 0)
            {
                return;
            }
            if (Value.SelectedIndex == -1)
            {
                MessageBox.Show(this, "You need to select a value first.");
                return;
            }
            ObjResponse resp = new ObjResponse(textbox_add.Text);
            ObjProperty prop = (ObjProperty)m_properties[Properties.SelectedIndex];
            ObjValue    val  = (ObjValue)prop.Values[Value.SelectedIndex];

            val.Responses.Add(resp);
            Response.Items.Add(resp.Name);
        }
Beispiel #11
0
 public Room(Point p)
     : base(p)
 {
     m_name = "Raum";
     m_type = Factory.ObjectType.Room;
       ObjProperty prop = new ObjProperty("description");
       m_properties.Add(prop);
       ObjValue val = new ObjValue(0);
       prop.Values.Add(val);
       ObjResponse resp = new ObjResponse("text");
       resp.Operation = Opcode.textout;
       resp.Arguments[0] = "Raumbeschreibung";
       val.Responses.Add(resp);
       ObjProperty state = new ObjProperty("state");
       m_properties.Add(state);
       ObjValue stateval = new ObjValue(0);
       state.Values.Add(stateval);
 }
Beispiel #12
0
        public Room(Point p) : base(p)
        {
            m_name = "Raum";
            m_type = Factory.ObjectType.Room;
            ObjProperty prop = new ObjProperty("description");

            m_properties.Add(prop);
            ObjValue val = new ObjValue(0);

            prop.Values.Add(val);
            ObjResponse resp = new ObjResponse("text");

            resp.Operation    = Opcode.textout;
            resp.Arguments[0] = "Raumbeschreibung";
            val.Responses.Add(resp);
            ObjProperty state = new ObjProperty("state");

            m_properties.Add(state);
            ObjValue stateval = new ObjValue(0);

            state.Values.Add(stateval);
        }
 private void button_property_Click(object sender, System.EventArgs e)
 {
     if (textbox_add.Text.Length == 0)
     return;
       ObjProperty prop = new ObjProperty(textbox_add.Text);
       m_properties.Add(prop);
       Properties.Items.Add(prop.Name);
 }