/// <summary> /// Removes a hook function from the unit. /// </summary> /// <param name="hookFunctionId">The hook function to be removed.</param> private void RemoveHookFunction(string hookFunctionId) { HookFunction hookFunction = hookFunctions[hookFunctionId]; hookFunction.CheckRemovalEffect(); hookFunctions.Remove(hookFunctionId); }
public static IServiceCollection AddElasticSearchClient(this IServiceCollection services, Configuration configuration) { var pool = new StaticConnectionPool(configuration.NodesUri); var settings = new ConnectionSettings(pool); settings.DefaultIndex(configuration.DefaultIndex); _client = new ElasticClient(settings); EnsureIndex(_client, _client.ConnectionSettings.DefaultIndex); services.AddSingleton(_client); services.AddScoped <IIndexService, IndexService>(); services.AddScoped <ITriggerService, TriggerService>(); IHookFunction hookFunction = new HookFunction(); services.AddSingleton(hookFunction); services.AddSingleton <IExecuteTrigger, ExecuteTrigger>(); services.BuildServiceProvider().GetService <IExecuteTrigger>(); _client.Mapping <Group, GroupDTO>(s => s.SetType("group") .SetKeyProperty(item => item.ID) .SetMethodDelete(DeleteGroupIndex) .SetMakeMethod(MakeMethod.Delete, MakeMethod.Insert) .SetQuery(QueryExpression.BuildQuery <Group>() .Include(item => item.GroupRoles) .ThenInclude(item => item.Role) .Include(item => item.GroupUsers) .ThenInclude(item => item.User))); return(services); }
public static void ReplacementFunction(GameObject *obj) { switch (_gameHandler.CurrentStage) { case Stage.TwinkleCircuit: case Stage.TwinkleCircuitOne: case Stage.TwinkleCircuitTwo: case Stage.TwinkleCircuitThree: case Stage.TwinkleCircuitFour: case Stage.TwinkleCircuitFive: case Stage.TwinkleCircuitSix: case Stage.SkyChaseOne: case Stage.SkyChaseTwo: HookFunction.OriginalFunction(obj); break; default: ChangePlayerAction(Players.P1, PlayerAction.BumperCar); obj->Info->Action = 3; break; } }
/// <summary> /// Adds a hook function to the unit. /// </summary> /// <param name="hookFunction">The hook function to be added.</param> private void AddHookFunction(HookFunction hookFunction) { hookFunctions.Add(hookFunction.GetHookFunctionID(), hookFunction); hookFunction.SetAttachedUnit(this); hookFunction.CheckApplicationEffect(); }