示例#1
0
        static void Main(string[] args)
        {
            ButtonLogic rb = new ButtonLogic();

            rb.SetList();

            Console.WriteLine(rb.groupA.Count);
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            _bl       = new ButtonLogic();
            stopwatch = new MyTimer();
            _bl.SetList();

            SetButtonText(_bl.groupA);
        }
        public PressButtonStep(ButtonLogic button, Agent agent, World world)
        {
            Button = button;
            Agent  = agent;
            Cost   = 1.0f;           // Distance from agent? Time?

            Expected = world.Step(); // Make a deep copy here?
            var results = Expected.GetState(button.gameObject.name) as ButtonPlanningState;

            results.IsPressed = true;
        }
示例#4
0
文件: ButtonList.cs 项目: larnin/LD44
    public void Hover(ButtonLogic button)
    {
        int index = ButtonIndex(button);

        if (index < 0)
        {
            return;
        }

        SetIndex(index);
    }
示例#5
0
文件: ButtonList.cs 项目: larnin/LD44
    public void Idle(ButtonLogic button)
    {
        int index = ButtonIndex(button);

        if (index < 0)
        {
            return;
        }

        if (m_currentIndex == index)
        {
            SetIndex(-1);
        }
    }
示例#6
0
文件: ButtonList.cs 项目: larnin/LD44
    public void Press(ButtonLogic button)
    {
        int index = ButtonIndex(button);

        if (index < 0)
        {
            return;
        }

        SetIndex(index);
        button.SetPressed();

        Event <ButtonPressEvent> .Broadcast(new ButtonPressEvent(index));

        SoundSystem.Instance().play(m_pressSound);
    }
示例#7
0
文件: ButtonList.cs 项目: larnin/LD44
    public void Remove(ButtonLogic button)
    {
        int index = ButtonIndex(button);

        if (index < 0)
        {
            return;
        }

        if (m_currentIndex == index)
        {
            SetIndex(-1);
        }

        m_buttons.Remove(button);
    }
示例#8
0
 // Use this for initialization
 void Start()
 {
     broadcast = true;
     Button    = GetComponent <ButtonLogic>();
     // == PRECONDITIONS == //
     preconditions = new StateList();
     // All of the blocking doors must be opened
     foreach (DoorLogic d in BlockingDoors)
     {
         string state = d.gameObject.name + " is open";
         preconditions.SetState(state, 1.0f);
     }
     // The button has to not be already pressed
     preconditions.SetState(Button.gameObject.name + " is pressed", 0.0f);
     // == POSTCONDITIONS == //
     postconditions = new StateList();
     // Our postconditions is the button is pressed
     postconditions.SetState(Button.gameObject.name + " is pressed", 1.0f);
     // And the door the button was hooked up to is opened
     if (Button.door)
     {
         postconditions.SetState(Button.door.gameObject.name + " is open", 1.0f);
     }
 }
 public ButtonPlanningState(ButtonLogic button)
 {
     Name      = button.gameObject.name;
     IsPressed = button.IsPressed;
     Position  = button.transform.position;
 }
示例#10
0
 void Start()
 {
     rScript = Right.GetComponent<ButtonLogic>();
     lScript = Left.GetComponent<ButtonLogic>();
     jScript = Jump.GetComponent<ButtonLogic>();
 }
示例#11
0
文件: ButtonList.cs 项目: larnin/LD44
 int ButtonIndex(ButtonLogic button)
 {
     return(m_buttons.IndexOf(button));
 }