Exemplo n.º 1
0
        public override void CreateStaticNodesIfNotPresent()
        {
            base.CreateStaticNodesIfNotPresent();

            if (InputEvents.Count == 0)
            {
                EntityLink <MonsterTestBase> InputLink = new EntityLink <MonsterTestBase>();
                InputLink.SetOwner(this);
                InputLink.Name = "Input";
                InputEvents.Add(InputLink);
            }

            /*		if(OutputEvents.Count != NumberOfOutputs)
             *              {
             *                      for(int CurrentLink = OutputEvents.Count; CurrentLink < NumberOfOutputs; ++CurrentLink)
             *                      {
             *                              EntityLink<MonsterTestBase> OutputLink = new EntityLink<MonsterTestBase>();
             *                              OutputLink.SetOwner(this);
             *                              OutputLink.Name = "Option " + CurrentLink;
             *                              OutputEvents.Add(OutputLink);
             *                      }
             *
             *                      for(int CurrentLink = NumberOfOutputs; CurrentLink < OutputEvents.Count;)
             *                      {
             *                              OutputEvents[CurrentLink].BreakAllLinks();
             *                              OutputEvents.RemoveAt(CurrentLink);
             *                      }
             *              }*/
        }
Exemplo n.º 2
0
    public void Start()
    {
        //TODO Add weapons to the player
        weaponSystems = GameObject.Find(Player.NAME).GetComponents <WeaponSystem>();

        InputEvents.Add(this);
    }
Exemplo n.º 3
0
        public override void CreateStaticNodesIfNotPresent()
        {
            base.CreateStaticNodesIfNotPresent();

            if (InputEvents.Count != 1)
            {
                InputEvents.Clear();

                EntityLink <MonsterTestBase> InputLink = new EntityLink <MonsterTestBase>();
                InputLink.SetOwner(this);
                InputLink.Name = "Start Dialogue";
                InputEvents.Add(InputLink);
            }
            if (OutputEvents.Count != 3)
            {
                EntityLink <MonsterTestBase> OutputLink = new EntityLink <MonsterTestBase>();
                OutputLink.SetOwner(this);
                OutputLink.Name = "Game Finished";
                OutputEvents.Add(OutputLink);

                OutputLink = new EntityLink <MonsterTestBase>();
                OutputLink.SetOwner(this);
                OutputLink.Name = "Problem Encountered";
                OutputEvents.Add(OutputLink);

                OutputLink = new EntityLink <MonsterTestBase>();
                OutputLink.SetOwner(this);
                OutputLink.Name = "Navigation Required";
                OutputEvents.Add(OutputLink);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Registers the event for a given action.
 /// </summary>
 /// <param name="action">Action.</param>
 /// <param name="callback">Callback.</param>
 public void RegisterEvent(InputActions action, EventHandler callback)
 {
     if (!InputEvents.ContainsKey(action))
     {
         InputEvents.Add(action, null);
     }
     InputEvents[action] += callback;
 }
Exemplo n.º 5
0
        public void Update(double timeOffset)
        {
            if (IsRecording)
            {
                EventsRecordedThisFrame.Clear();

                for (int i = 0; i < Keyboard.NumberOfKeys; i++)
                {
                    if (mRecordingKeyPushed && InputManager.Keyboard.KeyPushed((Keys)i))
                    {
                        InputEvent <Keys, Keyboard.KeyAction> newEvent =
                            new InputEvent <Keys, Keyboard.KeyAction>(
                                timeOffset + TimeManager.CurrentTime - TimeRecordingStarted,
                                (Keys)i,
                                Keyboard.KeyAction.KeyPushed);

                        InputEvents.Add(newEvent);
                        EventsRecordedThisFrame.Add(newEvent);

                        InputEvents.Sort();
                    }
                    else if (mRecordingKeyTyped && InputManager.Keyboard.KeyTyped((Keys)i))  // Typed is true when pushed, so don't want to double the info
                    {
                        InputEvent <Keys, Keyboard.KeyAction> newEvent =
                            new InputEvent <Keys, Keyboard.KeyAction>(
                                timeOffset + TimeManager.CurrentTime - TimeRecordingStarted,
                                (Keys)i,
                                Keyboard.KeyAction.KeyTyped);

                        InputEvents.Add(newEvent);
                        EventsRecordedThisFrame.Add(newEvent);

                        InputEvents.Sort();
                    }
                    if (mRecordingKeyReleased && InputManager.Keyboard.KeyReleased((Keys)i))
                    {
                        InputEvent <Keys, Keyboard.KeyAction> newEvent =
                            new InputEvent <Keys, Keyboard.KeyAction>(
                                timeOffset + TimeManager.CurrentTime - TimeRecordingStarted,
                                (Keys)i,
                                Keyboard.KeyAction.KeyReleased);

                        InputEvents.Add(newEvent);
                        EventsRecordedThisFrame.Add(newEvent);
                        InputEvents.Sort();
                    }
                }
            }
        }
Exemplo n.º 6
0
        public override void CreateStaticNodesIfNotPresent()
        {
            base.CreateStaticNodesIfNotPresent();

            if (InputEvents.Count == 0)
            {
                EntityLink <MonsterTest> InputLink = new EntityLink <MonsterTest>();
                InputLink.SetOwner(this);
                InputLink.Name = "Test Started";
                InputEvents.Add(InputLink);

                InputLink = new EntityLink <MonsterTest>();
                InputLink.SetOwner(this);
                InputLink.Name = "Test Failed To Start";
                InputEvents.Add(InputLink);
            }
        }
Exemplo n.º 7
0
        public override void CreateStaticNodesIfNotPresent()
        {
            base.CreateStaticNodesIfNotPresent();

            if (InputEvents.Count != 3)
            {
                InputEvents.Clear();

                EntityLink <MonsterTestBase> InputLink = new EntityLink <MonsterTestBase>();
                InputLink.SetOwner(this);
                InputLink.Name = "Start New Game";
                InputEvents.Add(InputLink);

                InputLink = new EntityLink <MonsterTestBase>();
                InputLink.SetOwner(this);
                InputLink.Name = "Load Saved Game";
                InputEvents.Add(InputLink);

                InputLink = new EntityLink <MonsterTestBase>();
                InputLink.SetOwner(this);
                InputLink.Name = "Quit";
                InputEvents.Add(InputLink);
            }
            if (OutputEvents.Count != 3)
            {
                EntityLink <MonsterTestBase> OutputLink = new EntityLink <MonsterTestBase>();
                OutputLink.SetOwner(this);
                OutputLink.Name = "Game Started";
                OutputEvents.Add(OutputLink);

                OutputLink = new EntityLink <MonsterTestBase>();
                OutputLink.SetOwner(this);
                OutputLink.Name = "Game Failed To Start";
                OutputEvents.Add(OutputLink);

                OutputLink = new EntityLink <MonsterTestBase>();
                OutputLink.SetOwner(this);
                OutputLink.Name = "Quit";
                OutputEvents.Add(OutputLink);
            }
        }