ACR_CreatureBehavior.GameObjectManager.AddGameObject C# (CSharp) Method

AddGameObject() public method

Insert an object into the game object table.
public AddGameObject ( ACR_CreatureBehavior.GameObject Obj ) : void
Obj ACR_CreatureBehavior.GameObject Supplies the object to insert.
return void
        public void AddGameObject(GameObject Obj)
        {
            if (GameObjectTable.ContainsKey(Obj.ObjectId))
            {
                GameObjectTable[Obj.ObjectId] = Obj;
            }
            else
            {
                GameObjectTable.Add(Obj.ObjectId, Obj);
            }
        }

Usage Example

Example #1
0
        /// <summary>
        /// Construct a game object and insert it into an object table.
        /// </summary>
        /// <param name="ObjectId">The engine object id.</param>
        /// <param name="ObjectType">The object type code.</param>
        /// <param name="ObjectManager">The object manager to attach the object
        /// to.</param>
        public GameObject(uint ObjectId, GameObjectType ObjectType, GameObjectManager ObjectManager)
        {
            this.GameObjectId       = ObjectId;
            this.GameObjectTypeCode = ObjectType;
            this.ObjectManager      = ObjectManager;

            ObjectManager.AddGameObject(this);
        }
All Usage Examples Of ACR_CreatureBehavior.GameObjectManager::AddGameObject