private void RemoveActiveStrategy() { if (_activeStrategy == null) { return; } var revokePerPlayer = EventMap.Instance.RevokeStrategyEvents(_activeStrategy.strategyId, Time.CurrentTurn); foreach (int playerId in revokePerPlayer.Keys) { if (revokePerPlayer.TryGetValue(playerId, out List <TimedEvent> events)) { Incentives incentives = new Incentives(events) { UserId = playerId }; BackendWorker.GetInstance().SendReliable(incentives); } } EventMap.Instance.CleanupWithStrategyId(_activeStrategy.strategyId); _activeStrategy.Deinitialize(); _activeStrategy = null; }
internal ConflictStrategy ChangeActiveStrategy() { RemoveActiveStrategy(); _activeStrategy = new StateStrategy(BackendWorker.GetInstance(), PlayerData.Instance); return(_activeStrategy); }