示例#1
0
        protected virtual void Initialize(World world)
        {
            if (this.IsInitialized)
            {
                throw new Exception();
            }

            if (m_objectType == ObjectType.None)
            {
                throw new Exception();
            }

            this.World    = world;
            this.ObjectID = world.GetNewObjectID(m_objectType);

            this.CreationTime = DateTime.Now;
            this.CreationTick = this.World.TickNumber;

            this.World.AddGameObject(this);
            this.IsInitialized = true;
            this.World.AddChange(new ObjectCreatedChange(this));
        }
示例#2
0
        protected virtual void Initialize(World world)
        {
            if (this.IsInitialized)
                throw new Exception();

            if (m_objectType == ObjectType.None)
                throw new Exception();

            this.World = world;
            this.ObjectID = world.GetNewObjectID(m_objectType);

            this.CreationTime = DateTime.Now;
            this.CreationTick = this.World.TickNumber;

            this.World.AddGameObject(this);
            this.IsInitialized = true;
            this.World.AddChange(new ObjectCreatedChange(this));
        }