Example #1
0
 /// <summary>
 /// Initializes the perspective-specific <see cref="GameControlKeys"/>.
 /// </summary>
 static void InitPerspectiveSpecificKeys()
 {
     _moveUp = new GameControlKeys("Move Up", SKC("MoveUp"), SKC("MoveDown"));
     _moveDown = new GameControlKeys("Move Down", SKC("MoveDown"), SKC("MoveUp"));
     _moveStopHorizontal = new GameControlKeys("Move Stop Horizontal", null, _moveLeft.KeysDown.Concat(_moveRight.KeysDown));
     _moveStopVertical = new GameControlKeys("Move Stop Vertical", null, _moveUp.KeysDown.Concat(_moveDown.KeysDown));
     _moveStop = new GameControlKeys("Move Stop", null,
         _moveLeft.KeysDown.Concat(_moveRight.KeysDown).Concat(_moveUp.KeysDown).Concat(_moveDown.KeysDown));
 }
Example #2
0
        /// <summary>
        /// Creates a new <see cref="GameControl"/> and adds it to this <see cref="GameControlCollection"/>.
        /// </summary>
        /// <param name="keys">The <see cref="GameControlKeys"/>.</param>
        /// <param name="delay">The delay.</param>
        /// <param name="additionalRequirements">The additional requirements.</param>
        /// <param name="invokeHandler">The invoke handler.</param>
        /// <returns>
        /// The instance of the created <see cref="GameControl"/> that was added to this
        /// <see cref="GameControlCollection"/>.
        /// </returns>
        public GameControl CreateAndAdd(GameControlKeys keys, int delay, Func <bool> additionalRequirements,
                                        TypedEventHandler <GameControl> invokeHandler)
        {
            var c = new GameControl(keys)
            {
                Delay = delay, AdditionalRequirements = additionalRequirements
            };

            c.Invoked += invokeHandler;

            Add(c);
            return(c);
        }
Example #3
0
        /// <summary>
        /// Initializes the <see cref="GameControlsKeys"/> class.
        /// </summary>
        static GameControlsKeys()
        {
            // Create the GameControlKeys with the default keys
            _moveLeft = new GameControlKeys("Move Left", SKC("MoveLeft"), SKC("MoveRight"));
            _moveRight = new GameControlKeys("Move Right", SKC("MoveRight"), SKC("MoveLeft"));

            _attack = new GameControlKeys("Attack", SKC("Attack"));
            _useWorld = new GameControlKeys("Use World", SKC("UseWorld"));
            _useShop = new GameControlKeys("Use Shop", SKC("UseShop"));
            _talkToNPC = new GameControlKeys("Talk To NPC", SKC("TalkToNPC"));
            _pickUp = new GameControlKeys("Pick Up", SKC("PickUp"));

            var emoteKeysDown = SKCs("Emote_Modifier1", "Emote_Modifier2");
            _emoteEllipsis = new GameControlKeys("Emote Ellipsis", emoteKeysDown, null, SKCs("EmoteEllipsis"));
            _emoteExclamation = new GameControlKeys("Emote Exclamation", emoteKeysDown, null, SKCs("EmoteExclamation"));
            _emoteHeartbroken = new GameControlKeys("Emote Heartbroken", emoteKeysDown, null, SKCs("EmoteHeartbroken"));
            _emoteHearts = new GameControlKeys("Emote Hearts", emoteKeysDown, null, SKCs("EmoteHearts"));
            _emoteMeat = new GameControlKeys("Emote Meat", emoteKeysDown, null, SKCs("EmoteMeat"));
            _emoteQuestion = new GameControlKeys("Emote Question", emoteKeysDown, null, SKCs("EmoteQuestion"));
            _emoteSweat = new GameControlKeys("Emote Sweat", emoteKeysDown, null, SKCs("EmoteSweat"));

            var quickBarKeysDown = SKCs("QuickBarItem_Modifier1", "QuickBarItem_Modifier2");
            _quickBarItem0 = new GameControlKeys("Quick bar item 0", quickBarKeysDown, null, SKCs("QuickBarItem0"));
            _quickBarItem1 = new GameControlKeys("Quick bar item 1", quickBarKeysDown, null, SKCs("QuickBarItem1"));
            _quickBarItem2 = new GameControlKeys("Quick bar item 2", quickBarKeysDown, null, SKCs("QuickBarItem2"));
            _quickBarItem3 = new GameControlKeys("Quick bar item 3", quickBarKeysDown, null, SKCs("QuickBarItem3"));
            _quickBarItem4 = new GameControlKeys("Quick bar item 4", quickBarKeysDown, null, SKCs("QuickBarItem4"));
            _quickBarItem5 = new GameControlKeys("Quick bar item 5", quickBarKeysDown, null, SKCs("QuickBarItem5"));
            _quickBarItem6 = new GameControlKeys("Quick bar item 6", quickBarKeysDown, null, SKCs("QuickBarItem6"));
            _quickBarItem7 = new GameControlKeys("Quick bar item 7", quickBarKeysDown, null, SKCs("QuickBarItem7"));
            _quickBarItem8 = new GameControlKeys("Quick bar item 8", quickBarKeysDown, null, SKCs("QuickBarItem8"));
            _quickBarItem9 = new GameControlKeys("Quick bar item 9", quickBarKeysDown, null, SKCs("QuickBarItem9"));

            var windowKeysDown = SKCs("Window_Modifier1", "Window_Modifier2");
            _windowStats = new GameControlKeys("Stats window", windowKeysDown, null, SKCs("Window_Stats"));
            _windowSkills = new GameControlKeys("Skills window", windowKeysDown, null, SKCs("Window_Skills"));
            _windowInventory = new GameControlKeys("Inventory window", windowKeysDown, null, SKCs("Window_Inventory"));
            _windowEquipped = new GameControlKeys("Equipped window", windowKeysDown, null, SKCs("Window_Equipped"));
            _windowGuild = new GameControlKeys("Guild window", windowKeysDown, null, SKCs("Window_Guild"));

            // Initialize the keys specific to the perspective being used
            InitPerspectiveSpecificKeys();
        }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameControl"/> class.
 /// </summary>
 /// <param name="keys">The <see cref="GameControlKeys"/>.</param>
 public GameControl(GameControlKeys keys)
 {
     GameControlKeys = keys;
 }
Example #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameControl"/> class.
 /// </summary>
 /// <param name="keys">The <see cref="GameControlKeys"/>.</param>
 public GameControl(GameControlKeys keys)
 {
     GameControlKeys = keys;
 }
Example #6
0
 /// <summary>
 /// Initializes the perspective-specific <see cref="GameControlKeys"/>.
 /// </summary>
 static void InitPerspectiveSpecificKeys()
 {
     _jump = new GameControlKeys("Jump", SKC("MoveUp"));
     _moveStop = new GameControlKeys("Move Stop", null, _moveLeft.KeysDown.Concat(_moveRight.KeysDown));
 }