コード例 #1
0
 public static void UpdateInstancePosition(HouseSystemController attemptedConstruct)
 {
     if (attemptedConstruct == null) return;
     if (m_Instance == null) // should never happen, but if it does, make this the instance
     {
         m_Instance = attemptedConstruct;
     }
     else if (attemptedConstruct.Location != new Point3D(0,0,0)) // move the instance to it's location and delete it
     {
         m_Instance.Location = attemptedConstruct.Location;
         attemptedConstruct.Delete();
     }
 }
コード例 #2
0
 public static void UpdateInstancePosition(HouseSystemController attemptedConstruct)
 {
     if (attemptedConstruct == null)
     {
         return;
     }
     if (m_Instance == null) // should never happen, but if it does, make this the instance
     {
         m_Instance = attemptedConstruct;
     }
     else if (attemptedConstruct.Location != new Point3D(0, 0, 0)) // move the instance to it's location and delete it
     {
         m_Instance.Location = attemptedConstruct.Location;
         attemptedConstruct.Delete();
     }
 }
コード例 #3
0
        public HouseSystemController()
            : base(0xEDC)
        {
            this.Name = "House System Controller";
            this.Movable = false;
            this.Visible = false;

            if (m_Instance != null)
            {
                // there can only be one HouseSystemController game stone in the world
                m_Instance.Location = this.Location;
                Server.Commands.CommandHandlers.BroadcastMessage(AccessLevel.Administrator, 0x489,
                    "Existing HouseSystemController has been moved to this location (DON'T DELETE IT!).");
                Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback<HouseSystemController>(UpdateInstancePosition), this); 
            }
            else
                m_Instance = this;
        }
コード例 #4
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
                //_PoisonChancePenaltyPerFollower = reader.ReadDouble();
                _ItemsBlockPlacement = (HousePlacementItemBlocking)reader.ReadByte();
                _MobsBlockPlacement  = reader.ReadBool();
                _PetsBlockPlacement  = reader.ReadBool();
                _MinPlaceDelay       = reader.ReadInt();
                _MaxPlaceDelay       = reader.ReadInt();
                break;
            }
            m_Instance = this;
        }
コード例 #5
0
        public HouseSystemController()
            : base(0xEDC)
        {
            this.Name    = "House System Controller";
            this.Movable = false;
            this.Visible = false;

            if (m_Instance != null)
            {
                // there can only be one HouseSystemController game stone in the world
                m_Instance.Location = this.Location;
                Server.Commands.CommandHandlers.BroadcastMessage(AccessLevel.Administrator, 0x489,
                                                                 "Existing HouseSystemController has been moved to this location (DON'T DELETE IT!).");
                Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback <HouseSystemController>(UpdateInstancePosition), this);
            }
            else
            {
                m_Instance = this;
            }
        }
コード例 #6
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
            switch (version)
            {
                case 0:
                    //_PoisonChancePenaltyPerFollower = reader.ReadDouble();
                    _ItemsBlockPlacement = (HousePlacementItemBlocking)reader.ReadByte();
                    _MobsBlockPlacement = reader.ReadBool();
                    _PetsBlockPlacement = reader.ReadBool();
                    _MinPlaceDelay = reader.ReadInt();
                    _MaxPlaceDelay = reader.ReadInt();
                    break;
            }
            m_Instance = this;
        }