This class maintains state that links C# object state to undelrying engine game object representations.
        /// <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);
        }
        /// <summary>
        /// Construct a creature object and insert it into the object table.
        /// </summary>
        /// <param name="ObjectId">Supplies the creature object id.</param>
        /// <param name="ObjectManager">Supplies the object manager.</param>
        public CreatureObject(uint ObjectId, GameObjectManager ObjectManager) : base(ObjectId, GameObjectType.Creature, ObjectManager)
        {
            //
            // Cache state that doesn't change over the lifetime of the object
            // so as to avoid a need to call down into the engine for these
            // fields.
            //

            CreatureIsPC = Script.GetIsPC(ObjectId) != CLRScriptBase.FALSE ? true : false;
            CreatureIsDM = Script.GetIsDM(ObjectId) != CLRScriptBase.FALSE ? true : false;
            PerceivedObjects = new List<PerceptionNode>();
        }
        /// <summary>
        /// Construct an area object and insert it into the object table.
        /// </summary>
        /// <param name="ObjectId">Supplies the area object id.</param>
        /// <param name="ObjectManager">Supplies the object manager.</param>
        public AreaObject(uint ObjectId, GameObjectManager ObjectManager) : base(ObjectId, GameObjectType.Area, ObjectManager)
        {
            //
            // Cache state that doesn't change over the lifetime of the object
            // so as to avoid a need to call down into the engine for these
            // fields.
            //

            AreaInterior = Script.GetIsAreaInterior(ObjectId) != CLRScriptBase.FALSE ? true : false;
            AreaNatural = Script.GetIsAreaNatural(ObjectId) != CLRScriptBase.FALSE ? true : false;
            AreaUnderground = Script.GetIsAreaAboveGround(ObjectId) != CLRScriptBase.FALSE ? false : true;
        }
        /// <summary>
        /// Construct a module object and insert it into the object table.
        /// </summary>
        /// <param name="ObjectId">Supplies the object id.</param>
        /// <param name="ObjectManager">Supplies the object manager.</param>
        public ModuleObject(uint ObjectId, GameObjectManager ObjectManager) : base(ObjectId, GameObjectType.Module, ObjectManager)
        {
            //
            // Discover pre-created areas in the module.  Instanced areas will
            // be discovered when they are created.
            //

            foreach (uint AreaObjectId in Script.GetAreas())
            {
                AreaObject Area = new AreaObject(AreaObjectId, ObjectManager);
            }
        }
Esempio n. 5
0
 /// <summary>
 /// Initialize the server subsystem, from a context where it is safe to
 /// make calls to engine APIs.
 /// </summary>
 public static void Initialize()
 {
     ObjectManager = new GameObjectManager();
     PartyManager = new AIPartyManager();
 }
 /// <summary>
 /// Construct a door object and insert it into the object table.
 /// </summary>
 /// <param name="ObjectId">Supplies the creature object id.</param>
 /// <param name="ObjectManager">Supplies the object manager.</param>
 public DoorObject(uint ObjectId, GameObjectManager ObjectManager)
     : base(ObjectId, GameObjectType.Door, ObjectManager)
 {
 }
 /// <summary>
 /// Construct a trigger object and insert it into the object table.
 /// </summary>
 /// <param name="ObjectId">Supplies the creature object id.</param>
 /// <param name="ObjectManager">Supplies the object manager.</param>
 public TriggerObject(uint ObjectId, GameObjectManager ObjectManager)
     : base(ObjectId, GameObjectType.Trigger, ObjectManager)
 {
 }
 /// <summary>
 /// Initialize the server subsystem, from a context where it is safe to
 /// make calls to engine APIs.
 /// </summary>
 public static void Initialize()
 {
     ObjectManager = new GameObjectManager();
     PartyManager  = new AIPartyManager();
 }
 /// <summary>
 /// Construct a trigger object and insert it into the object table.
 /// </summary>
 /// <param name="ObjectId">Supplies the creature object id.</param>
 /// <param name="ObjectManager">Supplies the object manager.</param>
 public TriggerObject(uint ObjectId, GameObjectManager ObjectManager)
     : base(ObjectId, GameObjectType.Trigger, ObjectManager)
 {
 }