示例#1
0
文件: House.cs 项目: paroxysmal/ACE
        public House(uint slumlord_id, Player player)
        {
            Player = player;

            var house = new HouseData();

            var instance = DatabaseManager.World.GetLandblockInstanceByGuid(slumlord_id);

            if (instance == null)
            {
                return;
            }

            house.Position = new Position(instance.ObjCellId, instance.OriginX, instance.OriginY, instance.OriginZ, instance.AnglesX, instance.AnglesY, instance.AnglesZ, instance.AnglesW);
            house.Type     = HouseType.Cottage;

            var SlumLord = (SlumLord)WorldObjectFactory.CreateNewWorldObject(instance.WeenieClassId);

            if (SlumLord == null)
            {
                Console.WriteLine($"House constructor({slumlord_id:X8}): couldn't build slumlord");
                return;
            }

            house.SetBuyItems(SlumLord.GetBuyItems());
            house.SetRentItems(SlumLord.GetRentItems());

            house.BuyTime  = (uint)(player.HousePurchaseTimestamp ?? 0);
            house.RentTime = GetRentTimestamp();

            HouseData = house;
        }
示例#2
0
        public static HouseData GetHouseData(House house)
        {
            var houseData = new HouseData();

            houseData.SetRentItems(house.SlumLord.GetRentItems());
            houseData.SetPaidItems(house.SlumLord);

            return(houseData);
        }
示例#3
0
        /// <summary>
        /// Returns the HouseData structure for a House (rent and paid items)
        /// </summary>
        private static HouseData GetHouseData(House house)
        {
            var houseData = new HouseData();

            houseData.SetRentItems(house.SlumLord.GetRentItems());
            houseData.SetPaidItems(house.SlumLord);

            if (house.HouseStatus == HouseStatus.InActive)
            {
                houseData.MaintenanceFree = true;
            }

            return(houseData);
        }