public void LoadStrategy(AbstractStrategy s) { //s.SetAccountManager(_accountManager); s.IsLive = false; _strategies.Add(s); Console.WriteLine("Loaded" + s.ToString()); }
public Table(int id, int size, AbstractStrategy strategy, AbstractOutput output) { this.Id = id; this.Size = size; this.Seats = new List <AbstractSeat>(); this.Board = new List <Card>(); this.Board.Clear(); AbstractSeat prevSeat = new EmptySeat(this, null, null); for (int i = 1; i < this.Size; i++) { this.Seats.Add(prevSeat); prevSeat = new EmptySeat(this, null, prevSeat); } this.Seats.Add(prevSeat); this.Seats[0].Right = prevSeat; while (prevSeat.Right.Left == null) { prevSeat.Right.Left = prevSeat; prevSeat = prevSeat.Right; } this.SitIn(0, new ArtificialPlayer(strategy, output)); }
public override void changeStrategy(AbstractStrategy strategy) { StrategysType currentStrategyType = _currentStrategy.getStrategyType (); if (currentStrategyType == StrategysType.MOVE) { _creature.agent.Stop(); }; base.changeStrategy (strategy); }
//прерывание и смена состояния public virtual void changeStrategy(StrategysType strategyType) { if (_allStrategy.ContainsKey(strategyType)) { _currentStrategy = _allStrategy[strategyType]; _currentStrategy.onStartState(_target); _target = _currentStrategy.target; } }
public Player(PlayerConfig playerConfig, IGameService gameService, IMessageProvider messageProvider, PlayerState playerState, IActionExecutor actionExecutor, AbstractStrategy strategy) { _gameService = gameService; _messageProvider = messageProvider; _playerConfig = playerConfig; _playerState = playerState; _actionExecutor = actionExecutor; _strategy = strategy; }
public void addState(AbstractStrategy strategy, bool mainState = false) { if (mainState == null) mainState = false; _allStrategy.Add (strategy.getStrategyType(), strategy); if (mainState) { _currentStrategy = strategy; _currentStrategy.onStartState(_target); _target = _currentStrategy.target; } }
public Server(List<AbstractStrategy> strategies) { if (strategies.Count == 0) { throw new Exception("strategies must have at lease 1 strategy in it."); } foreach (var strategy in strategies) { strategy.SetServer(this); this.strategies[strategy.GetType()] = strategy; } currentStrategy = strategies[0]; }
public StrategyContext(AbstractStrategy strategy) { _strategy = strategy; }
/// <summary> /// /// </summary> /// <param name="strategyType">Must be subclass of Server.AbstractStrategy</param> /// <returns></returns> public bool UseStrategy(Type strategyType) { if (!strategyType.IsSubclassOf(typeof(AbstractStrategy))) { return false; } if (!strategies.ContainsKey(strategyType)) { return false; } currentStrategy = strategies[strategyType]; return true; }
public void LoadStrategy(AbstractStrategy s) { s.SetAccountManager(_accountManager); s.IsLive = true; _strategies.Add(s); }
public Player(AbstractStrategy strategy, string name) : base(strategy) { this.name = name; }
public Context(AbstractStrategy strategy) { this.strategy = strategy; }
/// <summary> /// Initializes a new instance of the <see cref="CreditSalesContext"/> class. /// </summary> /// <param name="creditStrategy"> /// The credit strategy. /// </param> public CreditSalesContext(AbstractStrategy creditStrategy) { this.Strategy = creditStrategy; }
public SortedList(List <int> numbers, AbstractStrategy strategy) { _numbers = numbers; _currentStrategy = strategy; }
public void SetStrategy(InputType type) { currentStrategy = strategiesList.FirstOrDefault(s => s.inputType == type); }
//прерывание и смена состояния public virtual void changeStrategy(AbstractStrategy startegy) { _currentStrategy = startegy; _currentStrategy.onStartState(_target); _target = _currentStrategy.target; }
protected Participant(AbstractStrategy strategy) { this.strategy = strategy; }
public ArtificialPlayer(AbstractStrategy strategy, AbstractOutput output) { this.strategy = strategy; this.output = output; }