示例#1
0
 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);
     }
 }
示例#4
0
        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);
     }
 }
示例#8
0
 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);
 }
示例#10
0
 public static int CompareSID(GameSource gs1, GameSource gs2)
 {
     return(gs1.SID.CompareTo(gs2.SID));
 }
示例#11
0
 public static void Destroy(GameSource gs)
 {
     gs.Manager.RemoveGameSource(gs);
 }
示例#12
0
 public void ChangeExecuteState(GameSource source)
 {
     temp_stateUpdating.Add(source);
 }