public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: { m_House = reader.ReadItem() as BaseHouse; goto case 0; } case 0: { m_Description = reader.ReadString(); m_Marked = reader.ReadBool(); m_Target = reader.ReadPoint3D(); m_TargetMap = reader.ReadMap(); UpdateHue(); break; } } FixRunes(); }
GameObject AddHouse(IHouse house, int houseIndexPosition) { if (m_housingParent == null) { Debug.LogError("Housing Parent is null!"); } GameObject prefab = m_housePrefabs.FirstOrDefault(x => x.GetComponent <HouseController>().Name == house.Name); if (prefab == null) { Debug.LogError($"Can't find prefab for House '{house.Name}'"); } GameObject housePrefab = Instantiate(prefab); housePrefab.transform.SetParent(m_housingParent); var prevHouse = BoughtHouses.FirstOrDefault(x => x.Value.GetComponent <HouseController>().HouseIndex == (houseIndexPosition - 1)).Value; Vector3 newPos = prevHouse != null?GetNewPosition(housePrefab, prevHouse) : Vector3.zero; housePrefab.transform.localPosition = newPos; HouseController houseController = housePrefab.GetComponent <HouseController>(); houseController.SetInfo(house); return(housePrefab); }
public UsersController(IMapper mapper, IManager manager, IHouse house, UserManager <AppUser> userManager) { _mapper = mapper; _managerRepo = manager; _houseRepo = house; this.userManager = userManager; }
public virtual bool ValidateUse(Mobile from, bool message) { if (Deleted) { return(false); } if (!Movable && !Fillable) { IHouse house = HousingHelper.FindHouseAt(this); if (house == null || !house.IsLockedDown(this)) { if (message) { from.SendLocalizedMessage(502946, "", 0x59); // That belongs to someone else. } return(false); } } if (from.Map != Map || !from.InRange(GetWorldLocation(), 2) || !from.InLOS(this)) { if (message) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. } return(false); } return(true); }
public override void OnDoubleClick(Mobile from) { if (m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null)) { return; } if (IsChildOf(from.Backpack)) { IHouse house = HousingHelper.FindHouseAt(from); if (house != null && house.IsOwner(from)) { from.SendLocalizedMessage(1042264); // Where would you like to place this head? from.Target = new InternalTarget(this); } else { from.SendLocalizedMessage(502115); // You must be in your house to do this. } } else { from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it. } }
public VendorInventory( IHouse house, GenericReader reader ) { m_House = house; /*int version = */ reader.ReadEncodedInt(); m_Owner = reader.ReadMobile(); m_VendorName = reader.ReadString(); m_ShopName = reader.ReadString(); m_Items = reader.ReadItemList(); m_Gold = reader.ReadInt(); m_ExpireTime = reader.ReadDeltaTime(); if ( m_Items.Count == 0 && m_Gold == 0 ) { Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Delete ) ); } else { TimeSpan delay = m_ExpireTime - DateTime.Now; m_ExpireTimer = new ExpireTimer( this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero ); m_ExpireTimer.Start(); } }
public override void OnDoubleClick(Mobile from) { if (m_IsRewardItem && !RewardSystem.CheckIsUsableBy(from, this, null)) { return; } if (IsChildOf(from.Backpack)) { IHouse house = HousingHelper.FindHouseAt(from); if (house != null && house.IsOwner(from)) { from.CloseGump(typeof(InternalGump)); from.SendGump(new InternalGump(this)); } else { from.SendLocalizedMessage(502092); // You must be in your house to do this. } } else { from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it. } }
public static bool ValidateDefault(Mobile from, BaseBoard board) { if (from.AccessLevel >= AccessLevel.GameMaster) { return(true); } if (!from.Alive) { return(false); } if (board.IsChildOf(from.Backpack)) { return(true); } object root = board.RootParent; if (root is Mobile && root != from) { return(false); } if (board.Deleted || board.Map != from.Map || !from.InRange(board.GetWorldLocation(), 1)) { return(false); } IHouse house = HousingHelper.FindHouseAt(board); return(house != null && house.IsOwner(from)); }
public void Placement_OnTarget(Mobile from, object targeted, object state) { IPoint3D p = targeted as IPoint3D; if (p == null) { return; } Point3D loc = new Point3D(p); IHouse house = HousingHelper.FindHouseAt(loc, from.Map, 16); if (house != null && house.IsCoOwner(from)) { bool northWall = BaseAddon.IsWall(loc.X, loc.Y - 1, loc.Z, from.Map); bool westWall = BaseAddon.IsWall(loc.X - 1, loc.Y, loc.Z, from.Map); if (northWall && westWall) { from.SendGump(new WreathDeedGump(from, loc, this)); } else { PlaceAddon(from, loc, northWall, westWall); } } else { from.SendLocalizedMessage(1042036); // That location is not in your house. } }
public SetTitlePrompt(int page, IHouse house, BasePlayerBB board) : base(board) { m_Page = page; m_House = house; m_Board = board; }
public static bool CheckAccess( IHouse house, Mobile from ) { if ( house.Public ) return !house.IsBanned( from ); return house.HasAccess( from ); }
public PlayerVendor(Mobile owner, IHouse house) { Owner = owner; House = house; m_BankAccount = 0; m_HoldGold = 4; ShopName = "Shop Not Yet Named"; m_SellItems = new Hashtable(); CantWalk = true; InitStats(75, 75, 75); InitBody(); InitOutfit(); TimeSpan delay = PayTimer.GetInterval(); m_PayTimer = new PayTimer(this, delay); m_PayTimer.Start(); m_NextPayTime = DateTime.Now + delay; }
public override void OnDoubleClick(Mobile from) { if (IsLockedDown) { IHouse house = HousingHelper.FindHouseAt(from); if (house != null && house.IsCoOwner(from)) { if (m_Fire != null) { TurnOff(); } else { TurnOn(); } } else { from.SendLocalizedMessage(502436); // That is not accessible. } } else { from.SendLocalizedMessage(502692); // This must be in a house and be locked down to work. } }
public void AddHouse(IHouse upgradeToHouse) { List <IHouse> houses = BoughtHouses.Values.Select(x => x.GetComponent <HouseController>().HouseInfo).ToList(); houses.Add(upgradeToHouse); UpdateHouses(houses); }
public RunebookEntry(GenericReader reader) { int version = reader.ReadByte(); switch (version) { case 2: { m_Hue = reader.ReadInt(); goto case 1; } case 1: { m_House = reader.ReadItem() as BaseHouse; goto case 0; } case 0: { m_Location = reader.ReadPoint3D(); m_Map = reader.ReadMap(); m_Description = reader.ReadString(); break; } } }
public PlayerVendor( Mobile owner, IHouse house ) { Owner = owner; House = house; m_BankAccount = 0; m_HoldGold = 4; ShopName = "Shop Not Yet Named"; m_SellItems = new Hashtable(); CantWalk = true; InitStats( 75, 75, 75 ); InitBody(); InitOutfit(); TimeSpan delay = PayTimer.GetInterval(); m_PayTimer = new PayTimer( this, delay ); m_PayTimer.Start(); m_NextPayTime = DateTime.Now + delay; }
static void Main(string[] args) { HouseFactory factory = new HouseFactory(); float latitude = 45; float longitude = 333; // let's build 5 panel houses IHouse panelHouse = factory.GetHouse(HouseType.Panel); for (int i = 0; i < 5; i++) { panelHouse.Build(latitude, longitude); latitude += .5f; longitude += .5f; } // let's build 10 brick houses IHouse brickHouse = factory.GetHouse(HouseType.Brick); for (int i = 0; i < 10; i++) { brickHouse.Build(latitude, longitude); latitude += 1.5f; longitude += 1.5f; } Console.ReadKey(); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); HouseBoat b = new HouseBoat(); //b.jumpin(); b.opendoor(); IHouse h = (IHouse)b; h.opendoor(); // h=null; // b=null; string a = "Hello"; string b = "Hello"; string c = "Hello"; c = c.ToUpper(); //HELLO string d = "Hello"; string d = d.SubString(0, 2); string d = d.SubString(0, 1); }
public VendorInventory(IHouse house, GenericReader reader) { m_House = house; /*int version = */ reader.ReadEncodedInt(); m_Owner = reader.ReadMobile(); m_VendorName = reader.ReadString(); m_ShopName = reader.ReadString(); m_Items = reader.ReadItemList(); m_Gold = reader.ReadInt(); m_ExpireTime = reader.ReadDeltaTime(); if (m_Items.Count == 0 && m_Gold == 0) { Timer.DelayCall(TimeSpan.Zero, new TimerCallback(Delete)); } else { TimeSpan delay = m_ExpireTime - DateTime.UtcNow; m_ExpireTimer = new ExpireTimer(this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero); m_ExpireTimer.Start(); } }
public virtual bool Dye(Mobile from, IDyeTub sender) { if (Deleted) { return(false); } IHouse house = HousingHelper.FindHouseAt(this); if (house != null && house.IsCoOwner(from)) { if (from.InRange(GetWorldLocation(), 1)) { Hue = sender.DyedHue; return(true); } else { from.SendLocalizedMessage(500295); // You are too far away to do that. return(false); } } else { return(false); } }
public void Resolve(IRequest request) { Console.WriteLine("Builder: House Builder Problem"); IHouseBuilder houseBuilder = new HouseBuilder(); IEngineer engineer = new Engineer(houseBuilder); IHouse house = engineer.BuildHouse(); Console.WriteLine("\nBedrooms:"); foreach (IBedRoom bedRoom in house.BedRooms) { Console.WriteLine(bedRoom.Name); } Console.WriteLine("\nBathrooms:"); foreach (IBathRoom bathRoom in house.BathRooms) { Console.WriteLine(bathRoom.Name); } Console.WriteLine("\nGarage:"); Console.WriteLine(house.Garage.Name); Console.WriteLine("\nKitchen:"); Console.WriteLine(house.Kitchen.Name); }
protected override void OnTarget(Mobile from, object targeted) { IPoint3D p = targeted as IPoint3D; Map map = from.Map; if (p == null || map == null || m_Deed.Deleted) { return; } if (m_Deed.IsChildOf(from.Backpack)) { BaseAddonContainer addon = m_Deed.Addon; Spells.SpellHelper.GetSurfaceTop(ref p); IHouse house = null; AddonFitResult res = addon.CouldFit(p, map, from, ref house); if (res == AddonFitResult.Valid) { addon.MoveToWorld(new Point3D(p), map); } else if (res == AddonFitResult.Blocked) { from.SendLocalizedMessage(500269); // You cannot build that there. } else if (res == AddonFitResult.NotInHouse) { from.SendLocalizedMessage(500274); // You can only place this in a house that you own! } else if (res == AddonFitResult.DoorsNotClosed) { from.SendMessage("You must close all house doors before placing this."); } else if (res == AddonFitResult.DoorTooClose) { from.SendLocalizedMessage(500271); // You cannot build near the door. } else if (res == AddonFitResult.NoWall) { from.SendLocalizedMessage(500268); // This object needs to be mounted on something. } if (res == AddonFitResult.Valid) { m_Deed.Delete(); house.Addons.Add(addon); } else { addon.Delete(); } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } }
public override void OnResponse(Mobile from, string text) { int page = m_Page; IHouse house = m_House; BasePlayerBB board = m_Board; if (house == null || !house.IsLockedDown(board)) { from.SendLocalizedMessage(1062396); // This bulletin board must be locked down in a house to be usable. return; } else if (!from.InRange(board.GetWorldLocation(), 2) || !from.InLOS(board)) { from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that. return; } else if (!CheckAccess(house, from)) { from.SendLocalizedMessage(1062398); // You are not allowed to post to this bulletin board. return; } else if (m_Greeting && !house.IsOwner(from)) { return; } text = text.Trim(); if (text.Length > 255) { text = text.Substring(0, 255); } if (text.Length > 0) { PlayerBBMessage message = new PlayerBBMessage(DateTime.UtcNow, from, text); if (m_Greeting) { board.Greeting = message; } else { board.Messages.Add(message); if (board.Messages.Count > 50) { board.Messages.RemoveAt(0); if (page > 0) { --page; } } } } from.SendGump(new PlayerBBGump(from, house, board, page)); }
public void Building(IHouse house) { var message = house.IsOptimalParams ? $"Построено здание площадью: {house.Heigth * house.Width} кв.м и периметром: {(house.Heigth + house.Width) * 2} м" : "Условия для строительсва не соблюдены"; Console.WriteLine(message); }
/// <summary> /// 默认构造函数 /// </summary> /// <param name="houseService">站点下房屋基础信息接口</param> /// <param name="buyService">房屋求购保存读取接口</param> /// <param name="accountService">帐号服务接口</param> public HouseBuyController(IHouse houseService, IBuyHouse buyService, IAccountService accountService) { this.houseService = houseService; this.buyService = buyService; this.accountService = accountService; }
public RunebookEntry(Point3D loc, Map map, string desc, IHouse house, int hue) { m_Location = loc; m_Map = map; m_Description = desc; m_House = house; m_Hue = hue; }
/// <summary> /// 默认构造函数 /// </summary> /// <param name="houseService">站点下房屋基础信息(基本不变)接口</param> /// <param name="buyService">房屋转让保存读取接口</param> /// <param name="accountService">帐号服务接口</param> public HouseTransferController(IHouse houseService, ITransferHouse buyService, IAccountService accountService) { this.houseService = houseService; this.transferService = buyService; this.accountService = accountService; }
private void Update() { if (m_housingManager.BoughtHouses.Count >= 1) { IHouse house = m_housingManager.BoughtHouses.Values.ElementAt(0).GetComponent <HouseController>().HouseInfo; m_houseOne.CurrentCapacity = house.CurrentCapacity; } }
private void OnUpgradeHouseClicked(IHouse currentHouse) { BuyHouseUIController controller = m_buyHouseCanvas.GetComponent <BuyHouseUIController>(); controller.HouseToUpgrade = currentHouse; controller.OnUpgradeHouse += OnUpgradeHouse; m_buyHouseCanvas.OnSetUI(true); }
public MovingCrate( IHouse house ) : base(0xE3D) { Hue = 0x8A5; Movable = false; m_House = house; }
static void Main(string[] args) { IGroupPicFactory woodDeveloper = new WoodFactory(); IHouse woodHouse = woodDeveloper.Create(); IGroupPicFactory panelDeveloper = new PanelFactory(); IHouse panelHouse = panelDeveloper.Create(); }
public MovingCrate(IHouse house) : base(0xE3D) { Hue = 0x8A5; Movable = false; m_House = house; }
public Game( IPlayerId playerId, IHouse house ) { PlayerId = playerId; House = house; }
private void OnUpgradeHouse(IHouse prevHouse, IHouse upgradeToHouse) { m_buyHouseCanvas.GetComponent <BuyHouseUIController>().OnUpgradeHouse -= OnUpgradeHouse; m_buyHouseCanvas.OnSetUI(false); m_housingManager.UpgradeHouse(prevHouse, upgradeToHouse); UpdateHouses(); }
/// <summary> /// 默认构造函数 /// </summary> /// <param name="site">站点基础信息接口</param> /// <param name="channel">一级频道服务接口 配合物品二级列表获取</param> /// <param name="car">站点下车辆基础信息接口</param> /// <param name="house">站点下房屋基础信息接口</param> public SiteCache(ISite site, IChannelService channel, ICar car, IHouse house) { this.site = site; this.channel = channel; this.car = car; //this.goods = goods;//因goods 采用二级频道 所以使用IChannelService this.house = house; }
public VendorInventory( IHouse house, Mobile owner, string vendorName, string shopName ) { m_House = house; m_Owner = owner; m_VendorName = vendorName; m_ShopName = shopName; m_Items = new ArrayList(); m_ExpireTime = DateTime.Now + GracePeriod; m_ExpireTimer = new ExpireTimer( this, GracePeriod ); m_ExpireTimer.Start(); }
public RentedVendor( Mobile owner, IHouse house, VendorRentalDuration duration, int rentalPrice, bool landlordRenew, int rentalGold ) : base(owner, house) { m_RentalDuration = duration; m_RentalPrice = m_RenewalPrice = rentalPrice; m_LandlordRenew = landlordRenew; m_RenterRenew = false; m_RentalGold = rentalGold; m_RentalExpireTime = DateTime.Now + duration.Duration; m_RentalExpireTimer = new RentalExpireTimer( this, duration.Duration ); m_RentalExpireTimer.Start(); }
public void AddHouse(IHouse house) { if (house == null) { throw new ArgumentNullException("house"); } if (this.Houses.Any(h => h.Name == house.Name)) { throw new DuplicateHouseException(string.Format(DuplicateHouseErrorMessage, house.Name)); } this.Houses.Add(house); }
public City( string name, IHouse controllingHouse, int defense, decimal upgradeCost, double initialFoodStorage, double foodProduction, decimal taxBase, CityType cityType = DefaultCityType) { this.Name = name; this.ControllingHouse = controllingHouse; this.Defense = defense; this.UpgradeCost = upgradeCost; this.FoodStorage = initialFoodStorage; this.FoodProduction = foodProduction; this.TaxBase = taxBase; this.availableMilitaryUnits = new List<IMilitaryUnit>(); this.armyStructures = new List<IArmyStructure>(); this.CityType = cityType; }
public ReclaimVendorGump( IHouse house ) : base(50, 50) { m_House = house; m_Vendors = new ArrayList( house.InternalizedVendors ); AddBackground( 0, 0, 170, 50 + m_Vendors.Count * 20, 0x13BE ); AddImageTiled( 10, 10, 150, 20, 0xA40 ); AddHtmlLocalized( 10, 10, 150, 20, 1061827, 0x7FFF, false, false ); // <CENTER>Reclaim Vendor</CENTER> AddImageTiled( 10, 40, 150, m_Vendors.Count * 20, 0xA40 ); for ( int i = 0; i < m_Vendors.Count; i++ ) { Mobile m = (Mobile) m_Vendors[i]; int y = 40 + i * 20; AddButton( 10, y, 0xFA5, 0xFA7, i + 1, GumpButtonType.Reply, 0 ); AddLabel( 45, y, 0x481, m.Name ); } }
public void Mark( Mobile m ) { m_Marked = true; m_House = HousingHelper.FindHouseAt( m ); if ( m_House == null ) { m_Target = m.Location; m_TargetMap = m.Map; } else { HouseSign sign = m_House.Sign; if ( sign != null ) m_Description = sign.Name; else m_Description = null; if ( m_Description == null || ( m_Description = m_Description.Trim() ).Length == 0 ) m_Description = "an unnamed house"; int x = m_House.BanLocation.X; int y = m_House.BanLocation.Y + 2; int z = m_House.BanLocation.Z; Map map = m_House.Map; if ( map != null && !map.CanFit( x, y, z, 16, false, false ) ) z = map.GetAverageZ( x, y ); m_Target = new Point3D( x, y, z ); m_TargetMap = map; } UpdateHue(); InvalidateProperties(); }
public HouseViewModel(IHouse house) { if (house == null) return; Update(house); }
public void Update(IHouse house) { КодДома = house.КодДома; Улица = house.Улица; НомерДома = house.НомерДома; КодЖПК = house.КодЖПК; }
public FacingGump( DecorativeShieldDeed shield, int itemID, Point3D location, IHouse house ) : base(150, 50) { m_Shield = shield; m_ItemID = itemID; m_Location = location; m_House = house; Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage( 0 ); AddBackground( 0, 0, 300, 150, 0xA28 ); AddItem( 90, 30, GetWestItemID( itemID ) ); AddItem( 180, 30, itemID ); AddButton( 50, 35, 0x867, 0x869, (int) Buttons.East, GumpButtonType.Reply, 0 ); AddButton( 145, 35, 0x867, 0x869, (int) Buttons.South, GumpButtonType.Reply, 0 ); }
public FacingGump( BannerDeed banner, int itemID, Point3D location, IHouse house ) : base(150, 50) { m_Banner = banner; m_ItemID = itemID; m_Location = location; m_House = house; Closable = true; Disposable = true; Dragable = true; Resizable = false; AddPage( 0 ); AddBackground( 0, 0, 300, 150, 0xA28 ); AddItem( 90, 30, itemID + 1 ); AddItem( 180, 30, itemID ); AddButton( 50, 35, 0x868, 0x869, (int) Buttons.East, GumpButtonType.Reply, 0 ); AddButton( 145, 35, 0x868, 0x869, (int) Buttons.South, GumpButtonType.Reply, 0 ); }
public AddonFitResult CouldFit( IPoint3D p, Map map, Mobile from, ref IHouse house ) { if ( Deleted ) return AddonFitResult.Blocked; foreach ( AddonContainerComponent c in m_Components ) { Point3D p3D = new Point3D( p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z ); if ( !map.CanFit( p3D.X, p3D.Y, p3D.Z, c.ItemData.Height, false, true, ( c.Z == 0 ) ) ) return AddonFitResult.Blocked; else if ( !BaseAddon.CheckHouse( from, p3D, map, c.ItemData.Height, ref house ) ) return AddonFitResult.NotInHouse; if ( c.NeedsWall ) { Point3D wall = c.WallPosition; if ( !BaseAddon.IsWall( p3D.X + wall.X, p3D.Y + wall.Y, p3D.Z + wall.Z, map ) ) return AddonFitResult.NoWall; } } Point3D p3 = new Point3D( p.X, p.Y, p.Z ); if ( !map.CanFit( p3.X, p3.Y, p3.Z, ItemData.Height, false, true, ( Z == 0 ) ) ) return AddonFitResult.Blocked; else if ( !BaseAddon.CheckHouse( from, p3, map, ItemData.Height, ref house ) ) return AddonFitResult.NotInHouse; if ( NeedsWall ) { Point3D wall = WallPosition; if ( !BaseAddon.IsWall( p3.X + wall.X, p3.Y + wall.Y, p3.Z + wall.Z, map ) ) return AddonFitResult.NoWall; } ArrayList doors = house.Doors; for ( int i = 0; i < doors.Count; ++i ) { BaseDoor door = doors[i] as BaseDoor; if ( door != null && door.Open ) return AddonFitResult.DoorsNotClosed; Point3D doorLoc = door.GetWorldLocation(); int doorHeight = door.ItemData.CalcHeight; foreach ( AddonContainerComponent c in m_Components ) { Point3D addonLoc = new Point3D( p.X + c.Offset.X, p.Y + c.Offset.Y, p.Z + c.Offset.Z ); int addonHeight = c.ItemData.CalcHeight; if ( doorLoc.InRange( addonLoc, 1 ) && ( addonLoc.Z == doorLoc.Z || ( ( addonLoc.Z + addonHeight ) > doorLoc.Z && ( doorLoc.Z + doorHeight ) > addonLoc.Z ) ) ) return AddonFitResult.DoorTooClose; } Point3D addonLo = new Point3D( p.X, p.Y, p.Z ); int addonHeigh = ItemData.CalcHeight; if ( doorLoc.InRange( addonLo, 1 ) && ( addonLo.Z == doorLoc.Z || ( ( addonLo.Z + addonHeigh ) > doorLoc.Z && ( doorLoc.Z + doorHeight ) > addonLo.Z ) ) ) return AddonFitResult.DoorTooClose; } return AddonFitResult.Valid; }
public SetTitlePrompt( int page, IHouse house, BasePlayerBB board ) : base(board) { m_Page = page; m_House = house; m_Board = board; }
public PlayerBarkeeper( Mobile owner, IHouse house ) : base("the barkeeper") { m_Owner = owner; House = house; m_Rumors = new BarkeeperRumor[3]; LoadSBInfo(); }
public static string CreateHouseLink(IHouse house, UrlHelper urlHelper) { if (house == null) return string.Empty; return urlHelper.Link(HouseRouteName, new {id = house.Identifier}); }
public static bool CheckHouse( Mobile from, Point3D p, Map map, int height, ref IHouse house ) { house = HousingHelper.FindHouseAt( p, map, height ); if ( from == null || house == null || !( house.IsOwner( from ) || house.IsCoOwner( from ) ) ) return false; return true; }
public static AddonFitResult CouldFit( Point3D p, Map map, Mobile from, ref IHouse house ) { if ( !map.CanFit( p.X, p.Y, p.Z, 20, true, true, true ) ) return AddonFitResult.Blocked; else if ( !BaseAddon.CheckHouse( from, p, map, 20, ref house ) ) return AddonFitResult.NotInHouse; else return CheckDoors( p, 20, house ); }
public static AddonFitResult CheckDoors( Point3D p, int height, IHouse house ) { ArrayList doors = house.Doors; for ( int i = 0; i < doors.Count; i++ ) { BaseDoor door = doors[i] as BaseDoor; if ( door != null && door.Open ) return AddonFitResult.DoorsNotClosed; Point3D doorLoc = door.GetWorldLocation(); int doorHeight = door.ItemData.CalcHeight; if ( doorLoc.InRange( p, 1 ) && ( p.Z == doorLoc.Z || ( ( p.Z + height ) > doorLoc.Z && ( doorLoc.Z + doorHeight ) > p.Z ) ) ) return AddonFitResult.DoorTooClose; } return AddonFitResult.Valid; }
public PostPrompt( int page, IHouse house, BasePlayerBB board, bool greeting, int cliloc ) : base(house) { m_Page = page; m_House = house; m_Board = board; m_Greeting = greeting; m_Cliloc = cliloc; }
public RenamePrompt( IHouse house ) : base(house) { m_House = house; }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 1: { m_House = reader.ReadItem() as BaseHouse; goto case 0; } case 0: { m_Description = reader.ReadString(); m_Marked = reader.ReadBool(); m_Target = reader.ReadPoint3D(); m_TargetMap = reader.ReadMap(); UpdateHue(); break; } } FixRunes(); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadEncodedInt(); m_House = (IHouse) reader.ReadItem(); if ( m_House != null ) m_House.MovingCrate = this; Timer.DelayCall( TimeSpan.Zero, new TimerCallback( Hide ) ); if ( version == 0 ) MaxItems = -1; // reset to default }
public PlayerBBGump( Mobile from, IHouse house, BasePlayerBB board, int page ) : base(50, 10) { from.CloseGump( typeof( PlayerBBGump ) ); m_Page = page; m_From = from; m_House = house; m_Board = board; AddPage( 0 ); AddImage( 30, 30, 5400 ); AddButton( 393, 145, 2084, 2084, 4, GumpButtonType.Reply, 0 ); // Scroll up AddButton( 390, 371, 2085, 2085, 5, GumpButtonType.Reply, 0 ); // Scroll down AddButton( 32, 183, 5412, 5413, 1, GumpButtonType.Reply, 0 ); // Post message if ( house.IsOwner( from ) ) { AddButton( 63, 90, 5601, 5605, 2, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 81, 89, 230, 20, 1062400, LabelColor, false, false ); // Set title AddButton( 63, 109, 5601, 5605, 3, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 81, 108, 230, 20, 1062401, LabelColor, false, false ); // Post greeting } string title = board.Title; if ( title != null ) AddHtml( 183, 68, 180, 23, title, false, false ); AddHtmlLocalized( 385, 89, 60, 20, 1062409, LabelColor, false, false ); // Post AddLabel( 440, 89, LabelHue, page.ToString() ); AddLabel( 455, 89, LabelHue, "/" ); AddLabel( 470, 89, LabelHue, board.Messages.Count.ToString() ); PlayerBBMessage message = board.Greeting; if ( page >= 1 && page <= board.Messages.Count ) message = (PlayerBBMessage) board.Messages[page - 1]; AddImageTiled( 150, 220, 240, 1, 2700 ); // Seperator AddHtmlLocalized( 150, 180, 100, 20, 1062405, 16715, false, false ); // Posted On: AddHtmlLocalized( 150, 200, 100, 20, 1062406, 16715, false, false ); // Posted By: if ( message != null ) { AddHtml( 255, 180, 150, 20, message.Time.ToString( "yyyy-MM-dd HH:mm:ss" ), false, false ); Mobile poster = message.Poster; string name = ( poster == null ? null : poster.Name ); if ( name == null || ( name = name.Trim() ).Length == 0 ) name = "Someone"; AddHtml( 255, 200, 150, 20, name, false, false ); string body = message.Message; if ( body == null ) body = ""; AddHtml( 150, 240, 250, 100, body, false, false ); if ( message != board.Greeting && house.IsOwner( from ) ) { AddButton( 130, 395, 1209, 1210, 6, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 150, 393, 150, 20, 1062410, LabelColor, false, false ); // Banish Poster AddButton( 310, 395, 1209, 1210, 7, GumpButtonType.Reply, 0 ); AddHtmlLocalized( 330, 393, 150, 20, 1062411, LabelColor, false, false ); // Delete Message } if ( from.AccessLevel >= AccessLevel.GameMaster ) AddButton( 135, 242, 1209, 1210, 8, GumpButtonType.Reply, 0 ); // Post props } }