コード例 #1
0
        public GameManager()
        {
            parser = new LogFileParser();
            parser.StartWatching();
            ClickDelay = 100;
            locator = new Locator(parser);
            ActionMap = new Dictionary<Regex, Action<List<string>>>
            {
                [new Regex(@"\Aposition")] = GetPosition,
                [new Regex(@"\Aclick")] = Click,
                [new Regex(@"\Aend turn")] = EndTurn,
                [new Regex(@"\Aplay online")] = PlayGame,
                [new Regex(@"\Asolo adventures")] = SoloAdventures,
                [new Regex(@"\Ago back")] = GoBack,
                [new Regex(@"\Acard (10|[1-9])")] = HandCard,
                [new Regex(@"\Aplay (10|[1-9])")] = PlayCard,
                [new Regex(@"\Afriendly [1-9]")] = FriendlyBoard,
                [new Regex(@"\Aenemy [1-9]")] = OpposingBoard,
                [new Regex(@"\Apower")] = HeroPower,
                [new Regex(@"\Achampion")] = FriendlyPortrait,
                [new Regex(@"\Aface")] = OpposingPortrait,
                [new Regex(@"\Amulligan( [1-4]| confirm)+")] = Mulligan,
                [new Regex(@"\Aescape")] = Escape,
                [new Regex(@"\Acasual")] = SelectCasual,
                [new Regex(@"\Aranked")] = SelectRanked,
                [new Regex(@"\Aconcede game")] = ConcedeGame,
                [new Regex(@"\Aquest log")] = QuestLog,
                [new Regex(@"\Ablue button")] = BlueButton,
                [new Regex(@"\Acenter mouse")] = CenterMouse,
                [new Regex(@"\Ahide mouse")] = HideMouse,
                [new Regex(@"\Acancel search")] = GameCancel,
                [new Regex(@"\Amy collection")] = MyCollection,
                [new Regex(@"\Achoose [1-9]")] = ChooseDeck,
                [new Regex(@"\Adeck [1-9]")] = SelectBuildDeck,
                [new Regex(@"\Aselect [1-8]")] = ConstructCard,
                [new Regex(@"\Afilter [0-7]")] = FilterByMana,
                [new Regex(@"\Atoggle (10|[1-9])")] = CardBookTabs,
                [new Regex(@"\Ax marks the spot")] = OpenPack,
                [new Regex(@"\Aflip next")] = FlipNext,
                [new Regex(@"\Aflip back")] = FlipBack,
                [new Regex(@"\Athe arena")] = ArenaOpenButton,
                [new Regex(@"\Aarena play")] = ArenaPlayButton,
                [new Regex(@"\Aabuy pack")] = BuyPack,
                [new Regex(@"\Ashow only golden cards")] = ShowOnlyGoldenCards,
                [new Regex(@"\Ainclude uncraftable cards")] = IncludeUncraftableCards,
                [new Regex(@"\Atavern brawl")] = TavernBrawlButton,
                [new Regex(@"\Adisenchant card")] = DisenchantCard,
                [new Regex(@"\Acreate card")] = CreateCard,
                [new Regex(@"\Aconfirm disenchant")] = ConfirmDisenchant,
                [new Regex(@"\Acancel disenchant")] = CancelDisenchant,
                [new Regex(@"\Acrafting")] = CraftingButton,
                [new Regex(@"\Aopen packs")] = OpenPacksButton,
                [new Regex(@"\Ashop for cards")] = ShopButton,
                [new Regex(@"\Abuy arena admission")] = BuyArenaAdmission,

                [new Regex(@"\Aremove \d( \d)?")] = RemoveCardInDeckList,
                [new Regex(@"\Ascroll up")] = ScrollCardListUp,
                [new Regex(@"\Ascroll down")] = ScrollCardListDown,

                [new Regex(@"\A(up|right|down|left).+")] = MoveDirection,
                [new Regex(@"\A(thank you)|(sorry)|(well played)|(good game)|(oops)|(threaten)|(greetings)")] = Emote,
            };
        }