public GameSourceAdapter(GameSource source) { this.source = source; isGameObject = source.GetType() == typeof(GameObject); isComponent = source.GetType().IsSubclassOf(typeof(Component)); InitMembers(); }
/// <summary> /// Clear all components /// </summary> public void Clear() { for (int i = 0; i < components.Count; i++) { GameSource.Destroy(components[i]); } temp_remove.AddRange(components); }
private void _removeGS(GameSource source) { lock (GSList) { GSList.Remove(source); removed.Add(source); } }
private void _removeGS(GameSource source) { lock (GSList) { GSList.Remove(source); removed.Add(source); GSAdapterList.Remove(source.SID, (sid, adapter) => ((uint)sid).CompareTo(adapter.SID)); } }
private void _addGS(GameSource source) { lock (GSList) { if (!GSList.TryAdd(source)) { return; } added.Add(source); } }
/// <summary> /// Remove game source /// </summary> /// <param name="source">game source</param> public void RemoveGameSource(GameSource source) { if (updating) { lock (temp_remove) temp_remove.Add(source); } else { _removeGS(source); } }
/// <summary> /// Add gamer source /// </summary> /// <param name="source">game source</param> public void AddGameSource(GameSource source) { if (updating) { lock (temp_adding) temp_adding.Add(source); } else { _addGS(source); } }
private void _addGS(GameSource source) { lock (GSList) { if (!GSList.TryAdd(source)) { return; } added.Add(source); GSAdapterList.Add(new GameSourceAdapter(source)); } }
public void ChageExecuteState(GameSource source) { temp_stateRefresh.Add(source); }
public static int CompareSID(GameSource gs1, GameSource gs2) { return(gs1.SID.CompareTo(gs2.SID)); }
public static void Destroy(GameSource gs) { gs.Manager.RemoveGameSource(gs); }
public void ChangeExecuteState(GameSource source) { temp_stateUpdating.Add(source); }