Exemplo n.º 1
0
 /// <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);
 }
Exemplo n.º 2
0
 /// <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);
 }
Exemplo n.º 3
0
 public void Fire(T1 t1, T2 t2, T3 t3)
 {
     AssertThat.IsNotNull(_action, "Action is null, add listener first");
     _action(t1, t2, t3);
 }
Exemplo n.º 4
0
 public void CreateFolder(string path)
 {
     AssertThat.IsFalse(IsFileExist(path));
     Directory.CreateDirectory(path);
 }
Exemplo n.º 5
0
 public void DeleteFolder(string path)
 {
     AssertThat.IsTrue(IsFolderExist(path));
     Directory.Delete(path, true); //第二个参数:删除子目录
 }
Exemplo n.º 6
0
 public void MoveReadPositionTo(int index)
 {
     AssertThat.IsTrue(index < Capacity);
     ReadPosition = index;
 }
Exemplo n.º 7
0
 /// <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);
 }
Exemplo n.º 8
0
 public object GetObject(string name)
 {
     AssertThat.IsTrue(_objs.ContainsKey(name), "Do not have this key");
     return(_objs[name]);
 }
Exemplo n.º 9
0
 public void Regist <T>(T t) where T : ITick, new()
 {
     AssertThat.IsFalse(_ticks.Contains(t), "Tick list alreay has this componentBase");
     _ticks.Add(t);
 }
Exemplo n.º 10
0
 public void RecleimThisObjectToPool(T t)
 {
     AssertThat.IsFalse(_objects.Contains(t), "Already have this object");
     _objects.Add(t);
     t.OnObjectInPool();
 }
Exemplo n.º 11
0
 public void AddObject(string name, object obj)
 {
     AssertThat.IsFalse(_objs.ContainsKey(name), "Alread have this key");
     _objs[name] = obj;
 }
Exemplo n.º 12
0
 public void RemoveTask(ITick task)
 {
     AssertThat.IsTrue(_asyncTasks.Contains(task), "task not exist");
     _asyncTasks.Remove(task);
 }
Exemplo n.º 13
0
 public void AddTask(ITick task)
 {
     AssertThat.IsFalse(_asyncTasks.Contains(task), "task already exist");
     _asyncTasks.Add(task);
 }
Exemplo n.º 14
0
 /// <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);
 }
Exemplo n.º 15
0
 internal void Remove(ComponentBase componentBase)
 {
     AssertThat.IsTrue(_components.ContainsValue(componentBase), "ComponentBase is not exist");
 }
Exemplo n.º 16
0
 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);
 }
Exemplo n.º 17
0
 public void Fire(T t)
 {
     AssertThat.IsNotNull(_action, "Action is null, add listener first");
     _action(t);
 }
Exemplo n.º 18
0
 public void DeleteFile(string path)
 {
     AssertThat.IsTrue(IsFileExist(path));
     File.Delete(path);
 }
Exemplo n.º 19
0
 public void MoveWritePostionTo(int index)
 {
     AssertThat.IsTrue(index < Capacity);
     WritePosition = index;
 }
Exemplo n.º 20
0
 /// <summary>
 /// 移除组件
 /// </summary>
 /// <param name="component"></param>
 public void Remove(IComponent component)
 {
     AssertThat.IsNotNull(component, "Component is null");
     component.Dispose();
     components.Remove(component);
 }