Пример #1
0
        /// <summary>
        ///     Removes the specified component.
        /// </summary>
        public void RemoveComponent(LogicComponent component)
        {
            LogicArrayList <LogicComponent> components = this._components[component.GetComponentType()];

            int index = -1;

            for (int i = 0; i < components.Count; i++)
            {
                LogicComponent tmp = components[i];

                if (tmp.Equals(component))
                {
                    index = i;
                    break;
                }
            }

            if (index != -1)
            {
                components.Remove(index);
            }
        }
Пример #2
0
 /// <summary>
 ///     Adds the specified component to this instance.
 /// </summary>
 public void AddComponent(LogicComponent component)
 {
     this._components[component.GetComponentType()].Add(component);
 }