public StrongholdChecker(IStrongholdManager strongholdManager, IDbManager dbManager, IScheduler scheduler, ILocker locker) { this.strongholdManager = strongholdManager; this.dbManager = dbManager; this.scheduler = scheduler; this.locker = locker; }
public LockerWrapper(ILocker locker, Action onBeginLock, Action onEndLock) { _locker = locker; _onEndLock = onEndLock; _locker.Lock(); onBeginLock(); }
public BarbarianTribeBattlePassiveAction(uint barbarianTribeId, ILocker locker, IGameObjectLocator gameObjectLocator, IDbManager dbManager, Formula formula, BarbarianTribeBattleProcedure barbarianTribeBattleProcedure, IWorld world, ISimpleStubGeneratorFactory simpleStubGeneratorFactory) : this(locker, gameObjectLocator, dbManager, formula, barbarianTribeBattleProcedure, world, simpleStubGeneratorFactory) { this.barbarianTribeId = barbarianTribeId; this.locker = locker; this.gameObjectLocator = gameObjectLocator; this.dbManager = dbManager; this.formula = formula; this.barbarianTribeBattleProcedure = barbarianTribeBattleProcedure; this.world = world; IBarbarianTribe barbarianTribe; if (!gameObjectLocator.TryGetObjects(barbarianTribeId, out barbarianTribe)) { throw new Exception("Did not find barb tribe that was supposed to be having a battle"); } simpleStubGenerator = simpleStubGeneratorFactory.CreateSimpleStubGenerator(formula.BarbarianTribeUnitRatios(), formula.BarbarianTribeUnitTypes()); }
public WorkerOrderNumberRepository( CassandraStorage <WorkerOrderNumberStorageElement> storage, ILocker locker) { this.storage = storage; this.locker = locker; }
public CityRewardStrategy(ICity city, IBattleFormulas battleFormulas, Formula formula, ILocker locker) { this.city = city; this.battleFormulas = battleFormulas; this.formula = formula; this.locker = locker; }
public StrongholdCommandsModule(IStrongholdManager strongholdManager, IWorld world, ILocker locker, IThemeManager themeManager) { this.strongholdManager = strongholdManager; this.world = world; this.locker = locker; this.themeManager = themeManager; }
// Do not add more parameters to this class. If it needs anything pass it in with the method that needs the dependency. // We should try to move some of the logic outside of this class since it's getting big and becoming a bag for random methods. // Maybe split it up into more specific types. public Procedure(IRegionManager regions, Formula formula, IWorld world, ILocker locker) { this.regions = regions; this.formula = formula; this.world = world; this.locker = locker; }
public LeaderAwareTaskRunner(ILocker locker, string lockId, int lockPingTimeoutInSeconds = 30) { this.locker = locker; this.lockId = lockId; this.lockPingTimeoutInSeconds = lockPingTimeoutInSeconds; lockKeeperId = GenerateLockKeeperId(); }
public Notification(string code, IPackage package, User user, ILocker locker) { Code = code; Package = package; User = user; Locker = locker; }
public PlayersRemover(IPlayerSelector playerSelector, ICityRemoverFactory cityRemoverFactory, IScheduler scheduler, ILocker locker) { this.cityRemoverFactory = cityRemoverFactory; this.scheduler = scheduler; this.locker = locker; this.playerSelector = playerSelector; }
public LoginCommandsModule(IActionFactory actionFactory, ITribeManager tribeManager, IDbManager dbManager, ILocker locker, IWorld world, Procedure procedure, ICityFactory cityFactory, ILocationStrategyFactory locationStrategyFactory, IBarbarianTribeManager barbarianTribeManager, CallbackProcedure callbackProcedure, IChannel channel, IThemeManager themeManager, IPlayerFactory playerFactory, ILoginHandler loginHandler) { this.actionFactory = actionFactory; this.tribeManager = tribeManager; this.dbManager = dbManager; this.locker = locker; this.world = world; this.procedure = procedure; this.callbackProcedure = callbackProcedure; this.channel = channel; this.themeManager = themeManager; this.playerFactory = playerFactory; this.loginHandler = loginHandler; this.cityFactory = cityFactory; this.locationStrategyFactory = locationStrategyFactory; this.barbarianTribeManager = barbarianTribeManager; }
public static async Task LockForDurationAsync(this ILocker locker, object token, Func <Task> method) { locker.RequestLock(token); await method(); locker.RequestUnlock(token); }
public LaborMoveActiveAction(Formula formula, Procedure procedure, ILocker locker, IGameObjectLocator gameObjectLocator) { this.formula = formula; this.procedure = procedure; this.locker = locker; this.gameObjectLocator = gameObjectLocator; }
private ILocker GetAvailableLocker(Size size) { ILocker result = null; if (size == Size.Small && SmallLockers.Count > 0) { result = SmallLockers.Dequeue(); } if (result == null && size == Size.Medium && MediumLockers.Count > 0) { result = MediumLockers.Dequeue(); } if (result == null && size == Size.Large && LargeLockers.Count > 0) { result = LargeLockers.Dequeue(); } if (result == null && size == Size.XLarge && XLargeLockers.Count > 0) { result = XLargeLockers.Dequeue(); } if (result == null) { throw new Exception("All lockers are full"); } return(result); }
public ResourceSellActiveAction(ILocker locker, IWorld world, Formula formula) { this.locker = locker; this.world = world; this.formula = formula; }
protected virtual void OnFamilialLockerChanged(ILocker familialLocker, ILocker oldValue) { if (State == ViewModelState.CriticalOperation || State == ViewModelState.NonCriticalOperation) { oldValue?.RequestUnlock(_token); familialLocker?.RequestLock(_token); } }
protected virtual void OnFormRestrictorChanged(ILocker formRestrictor, ILocker oldValue) { if (State == ViewModelState.CriticalOperation) { oldValue?.RequestUnlock(_token); formRestrictor?.RequestLock(_token); } }
public static async Task <TReturn> LockForDurationAsync <TReturn>(this ILocker locker, object token, Func <Task <TReturn> > method) { locker.RequestLock(token); var returnObject = await method(); locker.RequestUnlock(token); return(returnObject); }
public TribeContributeActiveAction(IGameObjectLocator locator, Formula formula, ILocker locker) { this.locator = locator; this.formula = formula; this.locker = locker; }
public static TReturn LockForDuration <TReturn>(this ILocker locker, object token, Func <TReturn> method) { locker.RequestLock(token); var returnObject = method(); locker.RequestUnlock(token); return(returnObject); }
public BarbarianTribeCommandsLineModule(IBarbarianTribeManager barbarianTribeManager, ILocker locker, IWorld world) { this.barbarianTribeManager = barbarianTribeManager; this.locker = locker; this.world = world; }
public LockingMessageHook([NotNull] ILocker locker) { if (locker == null) { throw new ArgumentNullException("locker"); } this.locker = locker; }
public ActionWorker(Func <ILockable> lockDelegate, ILocation location, ILocker locker, IScheduler scheduler, IDbManager dbManager, RequirementFormula requirementFormula) { this.locker = locker; this.scheduler = scheduler; this.dbManager = dbManager; this.requirementFormula = requirementFormula; Location = location; LockDelegate = lockDelegate; }
public void Add(ILocker locker) => OperationWrapper(() => { if (_lockers.Contains(locker)) { return; } locker.LockStatusChanged += Locker_LockStatusChanged; _lockers.Add(locker); });
public CityCommandLineModule(Procedure procedure, IActionFactory actionFactory, ILocker locker, IWorld world) { this.procedure = procedure; this.actionFactory = actionFactory; this.locker = locker; this.world = world; }
public static ValueTask DisposeAsync(this ILocker locker) { if (locker is IAsyncDisposable asyncDisposable) { return(asyncDisposable.DisposeAsync()); } locker.Dispose(); return(default);
public UnitTrainActiveAction(UnitFactory unitFactory, ILocker locker, IWorld world, Formula formula) { this.unitFactory = unitFactory; this.locker = locker; this.world = world; this.formula = formula; }
public RetreatChainAction(IActionFactory actionFactory, IWorld world, Procedure procedure, ILocker locker) { this.actionFactory = actionFactory; this.world = world; this.procedure = procedure; this.locker = locker; }
public RemoveAuthorizeCacheEventHanlder( IStaticCacheManager staticCacheManager, ILogger <RemoveAuthorizeCacheEventHanlder> logger, ILocker locker ) { _staticCacheManager = staticCacheManager ?? throw new ArgumentNullException(nameof(staticCacheManager)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _locker = locker ?? throw new ArgumentNullException(nameof(locker)); }
public UnitUpgradeActiveAction(ILocker locker, IWorld world, Formula formula, UnitFactory unitFactory) { this.locker = locker; this.world = world; this.formula = formula; this.unitFactory = unitFactory; }
static void TestPayload(ILocker locker, int threadcount) { Thread[] threads = new Thread[threadcount]; Payload payload = new Payload(locker); for (var i = 0; i < threadcount; i++) { var thread = new Thread(new ThreadStart(payload.ThreadX)); threads[i] = thread; thread.Start(); } for (var i = 0; i < threadcount; i++) threads[i].Join(); }
public DesktopObserver(ILocker locker) { locker.RegisterObserver(this); }
protected RestCalculator(ILocker<Guid, Guid> locker, AccountObject accountObject, ExternalTransactionObject externalTransactionObject, InternalTransactionObject internalTransactionObject, List<Period> periods) { Locker = locker; AccountObject = accountObject; ExternalTransactionObject = externalTransactionObject; InternalTransactionObject = internalTransactionObject; Periods = periods; RetryCount = 3; LimitLockWaitForRecalc = 100; LimitLockWaitForCheck = 10; }
public PhoneObserver(ILocker locker) { _locker = locker; _locker.RegisterObserver(this); }
public SocialObserver(ILocker locker) { locker.RegisterObserver(this); }
public Payload(ILocker locker) { _locker = locker; }