Beispiel #1
0
        private List <ConstrucableTrigger> getActionTemplates()
        {
            List <ConstrucableTrigger> lst = new List <ConstrucableTrigger>();

            lst.Add(new ConstrucableTriggerTemplate("Center View", () => new ActionCenterView(new WeakParser(ActionCenterView.getComponents(), ActionCenterView.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Comment", () => new ActionComment(new WeakParser(ActionComment.getComponents(), ActionComment.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Create Unit", () => new ActionCreateUnit(new WeakParser(ActionCreateUnit.getComponents(), ActionCreateUnit.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Create Unit With Properties", () => new ActionCreateUnitWithProperties(new WeakParser(ActionCreateUnitWithProperties.getComponents(), ActionCreateUnitWithProperties.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Defeat", () => new ActionDefeat(new WeakParser(ActionDefeat.getComponents(), ActionDefeat.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Display Text Message", () => new ActionDisplayTextMessage(new WeakParser(ActionDisplayTextMessage.getComponents(), ActionDisplayTextMessage.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Draw", () => new ActionDraw(new WeakParser(ActionDraw.getComponents(), ActionDraw.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Give Units To Player", () => new ActionGiveUnitsToPlayer(new WeakParser(ActionGiveUnitsToPlayer.getComponents(), ActionGiveUnitsToPlayer.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Kill Unit", () => new ActionKillUnit(new WeakParser(ActionKillUnit.getComponents(), ActionKillUnit.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Kill Unit At Location", () => new ActionKillUnitAtLocation(new WeakParser(ActionKillUnitAtLocation.getComponents(), ActionKillUnitAtLocation.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Leader Board Control At Location", () => new ActionLeaderBoardControlAtLocation(new WeakParser(ActionLeaderBoardControlAtLocation.getComponents(), ActionLeaderBoardControlAtLocation.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Leader Board Control", () => new ActionLeaderBoardControl(new WeakParser(ActionLeaderBoardControl.getComponents(), ActionLeaderBoardControl.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Leader Board Deaths", () => new ActionLeaderBoardDeaths(new ActionLeaderBoardKills(new WeakParser(ActionLeaderBoardKills.getComponents(), ActionLeaderBoardKills.getTextMapping())))));
            lst.Add(new ConstrucableTriggerTemplate("Leader board Greed", () => new ActionLeaderboardGreed(new WeakParser(ActionLeaderboardGreed.getComponents(), ActionLeaderboardGreed.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Leader Board Kills", () => new ActionLeaderBoardKills(new WeakParser(ActionLeaderBoardKills.getComponents(), ActionLeaderBoardKills.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Leader Board Points", () => new ActionLeaderBoardPoints(new WeakParser(ActionLeaderBoardPoints.getComponents(), ActionLeaderBoardPoints.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Leader Board Resources", () => new ActionLeaderBoardResources(new WeakParser(ActionLeaderBoardResources.getComponents(), ActionLeaderBoardResources.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Leader Board Computer Players", () => new ActionLeaderboardComputerPlayers(new WeakParser(ActionLeaderboardComputerPlayers.getComponents(), ActionLeaderboardComputerPlayers.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Leader Board Goal Control At Location", () => new ActionLeaderboardGoalControlAtLocation(new WeakParser(ActionLeaderboardGoalControlAtLocation.getComponents(), ActionLeaderboardGoalControlAtLocation.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Leader Board Goal Control", () => new ActionLeaderboardGoalControl(new WeakParser(ActionLeaderboardGoalControl.getComponents(), ActionLeaderboardGoalControl.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Leader Board Goal Kills", () => new ActionLeaderboardGoalKills(new WeakParser(ActionLeaderboardGoalKills.getComponents(), ActionLeaderboardGoalKills.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Leader Board Goal Points", () => new ActionLeaderboardGoalPoints(new WeakParser(ActionLeaderboardGoalPoints.getComponents(), ActionLeaderboardGoalPoints.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Leader Board Goal Resources", () => new ActionLeaderboardGoalResources(new WeakParser(ActionLeaderboardGoalResources.getComponents(), ActionLeaderboardGoalResources.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Minimap Ping", () => new ActionMinimapPing(new WeakParser(ActionMinimapPing.getComponents(), ActionMinimapPing.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Modify Unit Energy", () => new ActionModifyUnitEnergy(new WeakParser(ActionModifyUnitEnergy.getComponents(), ActionModifyUnitEnergy.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Modify Unit Hanger Count", () => new ActionModifyUnitHangerCount(new WeakParser(ActionModifyUnitHangerCount.getComponents(), ActionModifyUnitHangerCount.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Modify Unit Hit Points", () => new ActionModifyUnitHitPoints(new WeakParser(ActionModifyUnitHitPoints.getComponents(), ActionModifyUnitHitPoints.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Modify Unit Resource Amount", () => new ActionModifyUnitResourceAmount(new WeakParser(ActionModifyUnitResourceAmount.getComponents(), ActionModifyUnitResourceAmount.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Modify Unit Shield Points", () => new ActionModifyUnitShieldPoints(new WeakParser(ActionModifyUnitShieldPoints.getComponents(), ActionModifyUnitShieldPoints.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Move Location", () => new ActionMoveLocation(new WeakParser(ActionMoveLocation.getComponents(), ActionMoveLocation.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Play WAV", () => new ActionPlayWAV(new WeakParser(ActionPlayWAV.getComponents(), ActionPlayWAV.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Move Unit", () => new ActionMoveUnit(new WeakParser(ActionMoveUnit.getComponents(), ActionMoveUnit.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Mute Unit Speech", () => new ActionMuteUnitSpeech(new WeakParser(ActionMuteUnitSpeech.getComponents(), ActionMuteUnitSpeech.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Order", () => new ActionOrder(new WeakParser(ActionOrder.getComponents(), ActionOrder.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Pause Game", () => new ActionPauseGame(new WeakParser(ActionPauseGame.getComponents(), ActionPauseGame.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Pause Timer", () => new ActionPauseTimer(new WeakParser(ActionPauseTimer.getComponents(), ActionPauseTimer.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Preserve Trigger", () => new ActionPreserveTrigger(new WeakParser(ActionPreserveTrigger.getComponents(), ActionPreserveTrigger.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Remove Unit", () => new ActionRemoveUnit(new WeakParser(ActionRemoveUnit.getComponents(), ActionRemoveUnit.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Remove Unit At Location", () => new ActionRemoveUnitAtLocation(new WeakParser(ActionRemoveUnitAtLocation.getComponents(), ActionRemoveUnitAtLocation.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Run AI Script", () => new ActionRunAIScript(new WeakParser(ActionRunAIScript.getComponents(), ActionRunAIScript.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Run AI Script At Location", () => new ActionRunAIScriptAtLocation(new WeakParser(ActionRunAIScriptAtLocation.getComponents(), ActionRunAIScriptAtLocation.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Set Alliance Status", () => new ActionSetAllianceStatus(new WeakParser(ActionSetAllianceStatus.getComponents(), ActionSetAllianceStatus.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Set Countdown Timer", () => new ActionSetCountdownTimer(new WeakParser(ActionSetCountdownTimer.getComponents(), ActionSetCountdownTimer.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Set Doodad State", () => new ActionSetDoodadState(new WeakParser(ActionSetDoodadState.getComponents(), ActionSetDoodadState.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Set Deaths", () => new ActionSetDeaths(new RawActionSetDeaths(new WeakParser(RawActionSetDeaths.getComponents(), RawActionSetDeaths.getTextMapping())))));
            lst.Add(new ConstrucableTriggerTemplate("Set Invincibility", () => new ActionSetInvincibility(new WeakParser(ActionSetInvincibility.getComponents(), ActionSetInvincibility.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Set Mission Objectives", () => new ActionSetMissionObjectives(new WeakParser(ActionSetMissionObjectives.getComponents(), ActionSetMissionObjectives.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Set Next Scenario", () => new ActionSetNextScenario(new WeakParser(ActionSetNextScenario.getComponents(), ActionSetNextScenario.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Set Resources", () => new ActionSetResources(new WeakParser(ActionSetResources.getComponents(), ActionSetResources.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Set Score", () => new ActionSetScore(new WeakParser(ActionSetScore.getComponents(), ActionSetScore.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Set Switch", () => new ActionSetSwitch(new WeakParser(ActionSetSwitch.getComponents(), ActionSetSwitch.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Talking Portrait", () => new ActionTalkingPortrait(new WeakParser(ActionTalkingPortrait.getComponents(), ActionTalkingPortrait.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Transmission", () => new ActionTransmission(new WeakParser(ActionTransmission.getComponents(), ActionTransmission.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Unmute Unit Speech", () => new ActionUnmuteUnitSpeech(new WeakParser(ActionUnmuteUnitSpeech.getComponents(), ActionUnmuteUnitSpeech.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Unpause Game", () => new ActionUnpauseGame(new WeakParser(ActionUnpauseGame.getComponents(), ActionUnpauseGame.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Unpause Timer", () => new ActionUnpauseTimer(new WeakParser(ActionUnpauseTimer.getComponents(), ActionUnpauseTimer.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Victory", () => new ActionVictory(new WeakParser(ActionVictory.getComponents(), ActionVictory.getTextMapping()))));
            lst.Add(new ConstrucableTriggerTemplate("Wait", () => new ActionWait(new WeakParser(ActionWait.getComponents(), ActionWait.getTextMapping()))));
            EPDAction.fillConstructables(lst);
            return(lst);
        }
Beispiel #2
0
 private Action getAction(CommandToken ct)
 {
     if (ct.isCenterView())
     {
         return(new ActionCenterView(this));
     }
     else if (ct.isComment())
     {
         return(new ActionComment(this));
     }
     else if (ct.isCreateUnit())
     {
         return(new ActionCreateUnit(this));
     }
     else if (ct.isCreateUnitWithProperties())
     {
         return(new ActionCreateUnitWithProperties(this));
     }
     else if (ct.isDefeat())
     {
         return(new ActionDefeat(this));
     }
     else if (ct.isDisplayTextMessage())
     {
         return(new ActionDisplayTextMessage(this));
     }
     else if (ct.isDraw())
     {
         return(new ActionDraw(this));
     }
     else if (ct.isGiveUnitsToPlayer())
     {
         return(new ActionGiveUnitsToPlayer(this));
     }
     else if (ct.isKillUnit())
     {
         return(new ActionKillUnit(this));
     }
     else if (ct.isKillUnitAtLocation())
     {
         return(new ActionKillUnitAtLocation(this));
     }
     else if (ct.isLeaderBoardControlAtLocation())
     {
         return(new ActionLeaderBoardControlAtLocation(this));
     }
     else if (ct.isLeaderBoardControl())
     {
         return(new ActionLeaderBoardControl(this));
     }
     else if (ct.isLeaderboardGreed())
     {
         return(new ActionLeaderboardGreed(this));
     }
     else if (ct.isLeaderBoardKills())
     {
         ActionLeaderBoardKills act = new ActionLeaderBoardKills(this);
         int[]          mapping     = ActionLeaderBoardKills.getTextMapping();
         int            unitIndex   = mapping[0];
         UnitVanillaDef unit        = act.get <UnitVanillaDef>(unitIndex);
         if (unit.getIndex() > unit.getMaxValue())
         {
             return(new ActionLeaderBoardDeaths(act));
         }
         return(act);
     }
     else if (ct.isLeaderBoardPoints())
     {
         return(new ActionLeaderBoardPoints(this));
     }
     else if (ct.isLeaderBoardResources())
     {
         return(new ActionLeaderBoardResources(this));
     }
     else if (ct.isLeaderboardComputerPlayers())
     {
         return(new ActionLeaderboardComputerPlayers(this));
     }
     else if (ct.isLeaderboardGoalControlAtLocation())
     {
         return(new ActionLeaderboardGoalControlAtLocation(this));
     }
     else if (ct.isLeaderboardGoalControl())
     {
         return(new ActionLeaderboardGoalControl(this));
     }
     else if (ct.isLeaderboardGoalKills())
     {
         return(new ActionLeaderboardGoalKills(this));
     }
     else if (ct.isLeaderboardGoalPoints())
     {
         return(new ActionLeaderboardGoalPoints(this));
     }
     else if (ct.isLeaderboardGoalResources())
     {
         return(new ActionLeaderboardGoalResources(this));
     }
     else if (ct.isMinimapPing())
     {
         return(new ActionMinimapPing(this));
     }
     else if (ct.isModifyUnitEnergy())
     {
         return(new ActionModifyUnitEnergy(this));
     }
     else if (ct.isModifyUnitHangerCount())
     {
         return(new ActionModifyUnitHangerCount(this));
     }
     else if (ct.isModifyUnitHitPoints())
     {
         return(new ActionModifyUnitHitPoints(this));
     }
     else if (ct.isModifyUnitResourceAmount())
     {
         return(new ActionModifyUnitResourceAmount(this));
     }
     else if (ct.isModifyUnitShieldPoints())
     {
         return(new ActionModifyUnitShieldPoints(this));
     }
     else if (ct.isMoveLocation())
     {
         return(new ActionMoveLocation(this));
     }
     else if (ct.isPlayWAV())
     {
         return(new ActionPlayWAV(this));
     }
     else if (ct.isMoveUnit())
     {
         return(new ActionMoveUnit(this));
     }
     else if (ct.isMuteUnitSpeech())
     {
         return(new ActionMuteUnitSpeech(this));
     }
     else if (ct.isOrder())
     {
         return(new ActionOrder(this));
     }
     else if (ct.isPauseGame())
     {
         return(new ActionPauseGame(this));
     }
     else if (ct.isPauseTimer())
     {
         return(new ActionPauseTimer(this));
     }
     else if (ct.isPreserveTrigger())
     {
         return(new ActionPreserveTrigger(this));
     }
     else if (ct.isRemoveUnit())
     {
         return(new ActionRemoveUnit(this));
     }
     else if (ct.isRemoveUnitAtLocation())
     {
         return(new ActionRemoveUnitAtLocation(this));
     }
     else if (ct.isRunAIScript())
     {
         return(new ActionRunAIScript(this));
     }
     else if (ct.isRunAIScriptAtLocation())
     {
         return(new ActionRunAIScriptAtLocation(this));
     }
     else if (ct.isSetAllianceStatus())
     {
         return(new ActionSetAllianceStatus(this));
     }
     else if (ct.isSetCountdownTimer())
     {
         return(new ActionSetCountdownTimer(this));
     }
     else if (ct.isSetDeaths())
     {
         RawActionSetDeaths rawDeaths = new RawActionSetDeaths(this);
         Action             epd       = EPDAction.getFromDeathAction(rawDeaths);
         if (epd != null)
         {
             return(epd);
         }
         else
         {
             try {
                 return(new ActionSetDeaths(rawDeaths));
             } catch (NotImplementedException) {
                 return(rawDeaths);
             }
             //return rawDeaths;
         }
     }
     else if (ct.isSetDoodadState())
     {
         return(new ActionSetDoodadState(this));
     }
     else if (ct.isSetInvincibility())
     {
         return(new ActionSetInvincibility(this));
     }
     else if (ct.isSetMissionObjectives())
     {
         return(new ActionSetMissionObjectives(this));
     }
     else if (ct.isSetNextScenario())
     {
         return(new ActionSetNextScenario(this));
     }
     else if (ct.isSetResources())
     {
         return(new ActionSetResources(this));
     }
     else if (ct.isSetScore())
     {
         return(new ActionSetScore(this));
     }
     else if (ct.isSetSwitch())
     {
         return(new ActionSetSwitch(this));
     }
     else if (ct.isTalkingPortrait())
     {
         return(new ActionTalkingPortrait(this));
     }
     else if (ct.isTransmission())
     {
         return(new ActionTransmission(this));
     }
     else if (ct.isUnmuteUnitSpeech())
     {
         return(new ActionUnmuteUnitSpeech(this));
     }
     else if (ct.isUnpauseGame())
     {
         return(new ActionUnpauseGame(this));
     }
     else if (ct.isUnpauseTimer())
     {
         return(new ActionUnpauseTimer(this));
     }
     else if (ct.isVictory())
     {
         return(new ActionVictory(this));
     }
     else if (ct.isWait())
     {
         return(new ActionWait(this));
     }
     throw new NotImplementedException();
 }