public Monster() { random = new Random(); components.Add(timerWrapper = new TimerWrapper()); timerWrapper.AutoCreateTimers = true; components.Add(brain = new FiniteStateMachine()); components.Add(targetComponent = new TargetingComponent <Player>(this)); }
public Monster() { random = new Random(); components.Add(timerWrapper = new TimerWrapper()); timerWrapper.AutoCreateTimers = true; components.Add(brain = new FiniteStateMachine()); components.Add(targetComponent = new TargetingComponent<Player>(this)); }
private TimerWrapper AddTimer(string timerName) { if (_timers.ContainsKey(timerName)) { return(_timers[timerName]); } var newTimer = new TimerWrapper(); _timers[timerName] = newTimer; return(newTimer); }
public void CountDown(string id, float timeRemaining, PublishTimeRemaining publishTimeRemaining, DoOnTime doOntimme) { if (Timers.ContainsKey(id)) { return; } TimerWrapper wrapper = new TimerWrapper(id, timeRemaining, publishTimeRemaining, doOntimme); Timers.Add(id, wrapper); }
public SplashLivePage() { Content = new ContentView(); // Temp, This will be overwritten shortly Title = ""; timer = new TimerWrapper(new TimeSpan(0, 0, 1), true, TimerElapsedEvt); NavigationPage.SetBackButtonTitle(this, "Live Tiles"); NavigationPage.SetHasBackButton(this, true); NavigationPage.SetHasNavigationBar(this, true); NavigationPage.SetBackButtonTitle(this, "Main"); App.Configuration.Initial(this, Palette._MainBackground); }
public FloatingBox(Base.ISettings settings) { InitializeComponent(); timer = TimerWrapper.wrap(() => { Dispatcher.Invoke(() => viewMsgBoxState(false)); }, 5000); RoutedEventHandler onLoaded = null; onLoaded = (sender, e) => { this.Loaded -= onLoaded; onLoadedInternal(settings); }; this.Loaded += onLoaded; }
public ManejadorAcciones(Cuenta _cuenta) { cuenta = _cuenta; fila_acciones = new ConcurrentQueue <AccionesScript>(); timeout_timer = new TimerWrapper(60000, time_Out_Callback); Personaje personaje = cuenta.juego.personaje; cuenta.juego.mapa.mapa_actualizado += evento_Mapa_Cambiado; cuenta.pelea.pelea_creada += get_Pelea_Creada; cuenta.juego.manejador.movimientos.movimiento_finalizado += evento_Movimiento_Celda; personaje.pregunta_npc_recibida += npcs_Preguntas_Recibida; personaje.inventario.almacenamiento_abierto += iniciar_Almacenamiento; personaje.inventario.almacenamiento_cerrado += cerrar_Almacenamiento; cuenta.juego.manejador.recoleccion.recoleccion_iniciada += get_Recoleccion_Iniciada; cuenta.juego.manejador.recoleccion.recoleccion_acabada += get_Recoleccion_Acabada; }
public ActionsManager(Account _cuenta, LuaScriptManager _manejador_script) { account = _cuenta; manejador_script = _manejador_script; fila_acciones = new ConcurrentQueue <ScriptAction>(); timer_out = new TimerWrapper(60000, time_Out_Callback); CharacterClass personaje = account.game.character; account.game.map.mapRefreshEvent += evento_Mapa_Cambiado; account.game.fight.pelea_creada += get_Pelea_Creada; account.game.manager.movimientos.movimiento_finalizado += evento_Movimiento_Celda; personaje.dialogo_npc_recibido += npcs_Dialogo_Recibido; personaje.dialogo_npc_acabado += npcs_Dialogo_Acabado; personaje.inventario.almacenamiento_abierto += iniciar_Almacenamiento; personaje.inventario.almacenamiento_cerrado += cerrar_Almacenamiento; account.game.manager.recoleccion.recoleccion_iniciada += get_Recoleccion_Iniciada; account.game.manager.recoleccion.recoleccion_acabada += get_Recoleccion_Acabada; }
public ManejadorAcciones(Account _cuenta, LuaManejadorScript _manejador_script) { cuenta = _cuenta; manejador_script = _manejador_script; fila_acciones = new ConcurrentQueue <AccionesScript>(); timer_out = new TimerWrapper(60000, time_Out_Callback); GameCharacter personaje = cuenta.Game.Character; cuenta.Game.Map.mapa_actualizado += evento_Mapa_Cambiado; cuenta.Game.Fight.pelea_creada += get_Pelea_Creada; cuenta.Game.Handler.movimientos.movimiento_finalizado += evento_Movimiento_Celda; personaje.dialogo_npc_recibido += npcs_Dialogo_Recibido; personaje.dialogo_npc_acabado += npcs_Dialogo_Acabado; personaje.inventario.almacenamiento_abierto += iniciar_Almacenamiento; personaje.inventario.almacenamiento_cerrado += cerrar_Almacenamiento; cuenta.Game.Handler.recoleccion.recoleccion_iniciada += get_Recoleccion_Iniciada; cuenta.Game.Handler.recoleccion.recoleccion_acabada += get_Recoleccion_Acabada; }
public ManejadorAcciones(Cuenta _cuenta, LuaManejadorScript _manejador_script) { cuenta = _cuenta; manejador_script = _manejador_script; fila_acciones = new ConcurrentQueue <AccionesScript>(); timer_out = new TimerWrapper(60000, time_Out_Callback); PersonajeJuego personaje = cuenta.juego.personaje; cuenta.juego.mapa.mapa_actualizado += evento_Mapa_Cambiado; cuenta.juego.pelea.pelea_creada += get_Pelea_Creada; cuenta.juego.manejador.movimientos.movimiento_finalizado += evento_Movimiento_Celda; cuenta.juego.npcs.respuestas_recibidas += npcs_Respuestas_Recibido; cuenta.juego.npcs.dialogo_acabado += npcs_Dialogo_Acabado; cuenta.juego.personaje.inventario.almacenamiento_abierto += iniciar_Almacenamiento; cuenta.juego.personaje.inventario.almacenamiento_cerrado += cerrar_Almacenamiento; cuenta.juego.manejador.recoleccion.recoleccion_iniciada += get_Recoleccion_Iniciada; cuenta.juego.manejador.recoleccion.recoleccion_acabada += get_Recoleccion_Acabada; cuenta.juego.manejador.interactivos.fin_interactivo += get_Interactivo_Finalizado; }
public void TimerWrapper_Construct() { var callCount = 0; var expectedState = new { myValue = true }; void callback(object state) { callCount++; } ITimer timerWrapper; using (timerWrapper = new TimerWrapper(callback, expectedState, 100, 100)) { Task.Delay(225).Wait(); } timerWrapper.Dispose(); Assert.AreEqual(2, callCount); }
private void BuildAndReturnWebServiceAndBrowser( ILogger logger, StatLightConfiguration statLightConfiguration, out IWebServer webServer, out List <IWebBrowser> webBrowsers, out IDialogMonitorRunner dialogMonitorRunner) { ClientTestRunConfiguration clientTestRunConfiguration = statLightConfiguration.Client; ServerTestRunConfiguration serverTestRunConfiguration = statLightConfiguration.Server; var location = new WebServerLocation(logger); var debugAssertMonitorTimer = new TimerWrapper(serverTestRunConfiguration.DialogSmackDownElapseMilliseconds); webServer = CreateWebServer(logger, statLightConfiguration, location); webBrowsers = GetWebBrowsers(logger, location.TestPageUrl, clientTestRunConfiguration, serverTestRunConfiguration.ShowTestingBrowserHost, serverTestRunConfiguration.QueryString, statLightConfiguration.Server.ForceBrowserStart); dialogMonitorRunner = SetupDialogMonitorRunner(logger, webBrowsers, debugAssertMonitorTimer); StartupBrowserCommunicationTimeoutMonitor(); }
// Constructor public ActionsManager(Account account) { _account = account; _actionsQueue = new ConcurrentQueue <ScriptAction>(); _timeoutTimer = new TimerWrapper(60000, Timeout_Callback); _account.Game.Map.MapChanged += Map_MapChanged; _account.Game.Managers.Movements.MovementFinished += Movements_MovementFinished; _account.Game.Managers.Interactives.UseFinished += Interactives_UseFinished; _account.Game.Fight.FightJoined += Fight_FightJoined; _account.Game.Managers.Gathers.GatherFinished += Gathers_GatherFinished; _account.Game.Managers.Gathers.GatherStarted += Gathers_GatherStarted; _account.Game.Npcs.QuestionReceived += Npcs_QuestionReceived; _account.Game.Storage.StorageStarted += Storage_StorageStarted; _account.Game.Storage.StorageLeft += Storage_StorageLeft; _account.Game.Npcs.DialogLeft += Npcs_DialogLeft; _account.Game.Exchange.ExchangeStarted += Exchange_ExchangeStarted; _account.Game.Exchange.ExchangeLeft += Exchange_ExchangeLeft; _account.Game.Bid.StartedBuying += Bid_StartedBuying; _account.Game.Bid.StartedSelling += Bid_StartedSelling; _account.Game.Bid.BidLeft += Bid_BidLeft; _account.Game.Managers.Teleportables.UseFinished += Teleportables_UseFinished; }
/// <summary> /// run all timer /// </summary> /// <param name="gameTime">time delly</param> public void Update(GameTime gameTime) { float deltaTime = (float)gameTime.ElapsedGameTime.TotalSeconds; List <string> dones = new List <string>(); foreach (string timerKey in Timers.Keys) { TimerWrapper wrapper = Timers[timerKey]; if (wrapper.TimeIsUp()) { wrapper.DoTask(); dones.Add(timerKey); } else { wrapper.UpdateTime(deltaTime); } } foreach (string done in dones) { Timers.Remove(done); } }
private IDialogMonitorRunner SetupDialogMonitorRunner(ILogger logger, List <IWebBrowser> webBrowsers, TimerWrapper debugAssertMonitorTimer) { var dialogMonitors = new List <IDialogMonitor> { new DebugAssertMonitor(logger), }; foreach (var webBrowser in webBrowsers) { var monitor = new MessageBoxMonitor(logger, webBrowser); dialogMonitors.Add(monitor); } return(new DialogMonitorRunner(logger, _eventPublisher, debugAssertMonitorTimer, dialogMonitors)); }
private IDialogMonitorRunner SetupDialogMonitorRunner(ILogger logger, List<IWebBrowser> webBrowsers, TimerWrapper debugAssertMonitorTimer) { var dialogMonitors = new List<IDialogMonitor> { new DebugAssertMonitor(logger), }; foreach (var webBrowser in webBrowsers) { var monitor = new MessageBoxMonitor(logger, webBrowser); dialogMonitors.Add(monitor); } return new DialogMonitorRunner(logger, _eventPublisher, debugAssertMonitorTimer, dialogMonitors); }
public void SetUp() { _timer = new Timer(); _uut = new TimerWrapper(_timer); }
private void BuildAndReturnWebServiceAndBrowser( ILogger logger, StatLightConfiguration statLightConfiguration, out IWebServer webServer, out List<IWebBrowser> webBrowsers, out IDialogMonitorRunner dialogMonitorRunner) { ClientTestRunConfiguration clientTestRunConfiguration = statLightConfiguration.Client; ServerTestRunConfiguration serverTestRunConfiguration = statLightConfiguration.Server; var location = new WebServerLocation(logger); var debugAssertMonitorTimer = new TimerWrapper(serverTestRunConfiguration.DialogSmackDownElapseMilliseconds); webServer = CreateWebServer(logger, statLightConfiguration, location); webBrowsers = GetWebBrowsers(logger, location.TestPageUrl, clientTestRunConfiguration, serverTestRunConfiguration.ShowTestingBrowserHost, serverTestRunConfiguration.QueryString, statLightConfiguration.Server.ForceBrowserStart); dialogMonitorRunner = SetupDialogMonitorRunner(logger, webBrowsers, debugAssertMonitorTimer); StartupBrowserCommunicationTimeoutMonitor(); }
private void MyCallBack(TimerWrapper wrapper) { wrapper.Timer. }
public IDisposable Schedule(Func<Task> recurringAction) { var timer = new TimerWrapper(recurringAction, TimeSpan.FromSeconds(5)); return timer; }
public IDisposable Schedule(Func <Task> recurringAction) { var timer = new TimerWrapper(recurringAction, TimeSpan.FromSeconds(5)); return(timer); }
public TimerViewModel() { TimerWrapper = new TimerWrapper(new Timer()); }