public void Setup() { MockCommand = new Mock <GameCommand>(); CommandStorage = new CommandStorageImpl( new[] { MockCommand.Object } ); }
/// <summary> /// Bind to a command when the TargetProperty is known /// </summary> /// <param name="control"></param> /// <param name="bindingOptions"></param> /// <param name="targetPropertyName"></param> public void ExecuteCommandBind(IBindingTarget control, Options bindingOptions, string targetPropertyName) { BindingDef binding = new BindingDef(control, targetPropertyName, bindingOptions, controlService); CommandStorage.Add(binding); ExecuteCommandBind(control, binding); }
public string GetCommandText(string commandID) { string cmdText = CommandStorage.GetCommandText(commandID); if (string.IsNullOrEmpty(cmdText)) { throw new Exception(string.Format("命令{0}不存在", commandID));//未找到指定命令抛出异常 } return(cmdText); }
/// <summary> /// Initializes a new battle. /// </summary> public static void InitBattle(Player[] Players, GameModeData GameMode) { if (Players.Length <= 0) { return; } ArenaData ArenaData = null; CommandStorage Storage = new CommandStorage(); CommandStorage Queue = new CommandStorage(); object Locker = new object(); for (int I = 0; I < Players.Length; I++) { if (ArenaData == null || Players[I].Arena.DemoteTrophyLimit > ArenaData.DemoteTrophyLimit) { ArenaData = Players[I].Arena; } } for (int I = 0; I < Players.Length; I++) { Player Player = Players[I]; Player.GameMode.LoadBattleState(); for (int J = 0; J < Players.Length; J++) { Player.GameMode.AddPlayer(Players[J], J); } Player.GameMode.Battle.SetArena(ArenaData); Player.GameMode.Battle.SetLocation(ArenaData.PvPLocationData); Player.GameMode.Battle.SetGameMode(GameMode); Player.GameMode.SectorManager.SetCommandStorage(Storage); Player.GameMode.SectorManager.SetCommandQueue(Queue); Player.GameMode.SectorManager.SetLocker(Locker); } BattleManager.InitBattleTimer(Players, Locker).Start(); }
public CommandExecutorImpl(UIInput input, CommandStorage commandStorage, Logger logger) { Input = input; CommandStorage = commandStorage; Logger = logger; }
/// <summary> /// Sets the command storage instance. /// </summary> public void SetCommandStorage(CommandStorage CommandStorage) { this.Commands = CommandStorage; }
/// <summary> /// Sets the command queue instance. /// </summary> public void SetCommandQueue(CommandStorage CommandStorage) { this.Queue = CommandStorage; }
public TeamPainterNetClient() { _commands = new CommandStorage(); _isActive = false; }