/// <summary> /// Remove key and all its actions /// </summary> /// <param name="key"></param> public void RemoveListener(string key) { AssertThat.IsTrue(container.ContainsKey(key)); container[key].Clear(); container.Remove(key); }
/// <summary> /// Remove key and all its actions /// </summary> /// <param name="key"></param> public void RemoveListener(string key) { AssertThat.IsTrue(_container.ContainsKey(key), "Do not have this key"); _container[key].Clear(); _container.Remove(key); }
public void Fire(T1 t1, T2 t2, T3 t3) { AssertThat.IsNotNull(_action, "Action is null, add listener first"); _action(t1, t2, t3); }
public void CreateFolder(string path) { AssertThat.IsFalse(IsFileExist(path)); Directory.CreateDirectory(path); }
public void DeleteFolder(string path) { AssertThat.IsTrue(IsFolderExist(path)); Directory.Delete(path, true); //第二个参数:删除子目录 }
public void MoveReadPositionTo(int index) { AssertThat.IsTrue(index < Capacity); ReadPosition = index; }
/// <summary> /// Add component to list /// </summary> /// <param name="component"></param> private void AddComponentToList(IComponent component) { AssertThat.IsNotNull(component); AssertThat.IsFalse(components.Contains(component)); components.Add(component); }
public object GetObject(string name) { AssertThat.IsTrue(_objs.ContainsKey(name), "Do not have this key"); return(_objs[name]); }
public void Regist <T>(T t) where T : ITick, new() { AssertThat.IsFalse(_ticks.Contains(t), "Tick list alreay has this componentBase"); _ticks.Add(t); }
public void RecleimThisObjectToPool(T t) { AssertThat.IsFalse(_objects.Contains(t), "Already have this object"); _objects.Add(t); t.OnObjectInPool(); }
public void AddObject(string name, object obj) { AssertThat.IsFalse(_objs.ContainsKey(name), "Alread have this key"); _objs[name] = obj; }
public void RemoveTask(ITick task) { AssertThat.IsTrue(_asyncTasks.Contains(task), "task not exist"); _asyncTasks.Remove(task); }
public void AddTask(ITick task) { AssertThat.IsFalse(_asyncTasks.Contains(task), "task already exist"); _asyncTasks.Add(task); }
/// <summary> /// Tick维护 /// </summary> public void Tick(float deltaTime) { AssertThat.IsNotNull(tickComponent, "Make sure tick is not null(should init API first to init framework)"); tickComponent.Tick(deltaTime); }
internal void Remove(ComponentBase componentBase) { AssertThat.IsTrue(_components.ContainsValue(componentBase), "ComponentBase is not exist"); }
public void Unregist <T>(T t) where T : ITick, new() { AssertThat.IsTrue(_ticks.Contains(t), "Tick list do not have this componentBase"); _ticks.Remove(t); }
public void Fire(T t) { AssertThat.IsNotNull(_action, "Action is null, add listener first"); _action(t); }
public void DeleteFile(string path) { AssertThat.IsTrue(IsFileExist(path)); File.Delete(path); }
public void MoveWritePostionTo(int index) { AssertThat.IsTrue(index < Capacity); WritePosition = index; }
/// <summary> /// 移除组件 /// </summary> /// <param name="component"></param> public void Remove(IComponent component) { AssertThat.IsNotNull(component, "Component is null"); component.Dispose(); components.Remove(component); }