C# Class Aura.Channel.World.Shops.PersonalShop

显示文件 Open project: aura-project/aura Class Usage Examples

Public Methods

Method Description
Buy ( Creature buyer, long itemEntityId, bool directBankTransaction ) : bool

Attempts to buy the given item for buyer, returns true if successful.

CanPlace ( Creature creature, string license ) : bool

Returns true if creature can place shop at their current location.

ChangeDescription ( string description ) : void

Changes shop's description.

ChangeTitle ( string title ) : void

Changes shop's title.

CloseFor ( Creature creature ) : void

Opens shop for given creature.

GetAllItems ( ) : List

Returns new list of all items in shop's bag.

GetBagLayout ( ) : string

Returns the layout of the bag, used in the shop open packet.

GetPricedItems ( ) : List

Returns new list of all items with prices in shop's bag.

OpenFor ( Creature creature ) : void

Opens shop for given creature.

PersonalShop ( Creature owner, Item bag, Item license ) : Aura.Channel.Network.Sending

Creates new PersonalShop instance. Does not actually create shop.

SetOverseer ( Creature overseer, long itemEntityId ) : bool

Sets the shop's overseer (brownie/pet).

SetPrice ( long itemEntityId, int price ) : bool

Sets the price for the given item, returns true on success.

SetPrices ( long itemEntityId, int price ) : bool

Sets the price for the given item, returns true on success.

SetUp ( string title, string description ) : bool

Sets up shop, spawning the prop.

TakeDown ( ) : void

Closes the shop for all customers and takes it down, removing the prop.

Private Methods

Method Description
ForAllCustomers ( Action action ) : void

Executes the given action for all current customers.

GetPlacementPosition ( Position pos, byte direction ) : Position

Returns position for the shop, based on given position and direction.

GetShopPropId ( Item item ) : int

Returns the prop id to be used for the given bag.

UpdatePrice ( Item item, int price ) : void

Updates price for given item and updates clients.

Method Details

Buy() public method

Attempts to buy the given item for buyer, returns true if successful.
public Buy ( Creature buyer, long itemEntityId, bool directBankTransaction ) : bool
buyer Aura.Channel.World.Entities.Creature
itemEntityId long
directBankTransaction bool
return bool

CanPlace() public static method

Returns true if creature can place shop at their current location.
public static CanPlace ( Creature creature, string license ) : bool
creature Aura.Channel.World.Entities.Creature
license string
return bool

ChangeDescription() public method

Changes shop's description.
public ChangeDescription ( string description ) : void
description string
return void

ChangeTitle() public method

Changes shop's title.
public ChangeTitle ( string title ) : void
title string
return void

CloseFor() public method

Opens shop for given creature.
public CloseFor ( Creature creature ) : void
creature Aura.Channel.World.Entities.Creature
return void

GetAllItems() public method

Returns new list of all items in shop's bag.
public GetAllItems ( ) : List
return List

GetBagLayout() public method

Returns the layout of the bag, used in the shop open packet.
public GetBagLayout ( ) : string
return string

GetPricedItems() public method

Returns new list of all items with prices in shop's bag.
public GetPricedItems ( ) : List
return List

OpenFor() public method

Opens shop for given creature.
public OpenFor ( Creature creature ) : void
creature Aura.Channel.World.Entities.Creature
return void

PersonalShop() public method

Creates new PersonalShop instance. Does not actually create shop.
public PersonalShop ( Creature owner, Item bag, Item license ) : Aura.Channel.Network.Sending
owner Aura.Channel.World.Entities.Creature
bag Item
license Item
return Aura.Channel.Network.Sending

SetOverseer() public method

Sets the shop's overseer (brownie/pet).
public SetOverseer ( Creature overseer, long itemEntityId ) : bool
overseer Aura.Channel.World.Entities.Creature Set to null to remove overseer.
itemEntityId long
return bool

SetPrice() public method

Sets the price for the given item, returns true on success.
public SetPrice ( long itemEntityId, int price ) : bool
itemEntityId long
price int
return bool

SetPrices() public method

Sets the price for the given item, returns true on success.
public SetPrices ( long itemEntityId, int price ) : bool
itemEntityId long
price int
return bool

SetUp() public method

Sets up shop, spawning the prop.
public SetUp ( string title, string description ) : bool
title string
description string
return bool

TakeDown() public method

Closes the shop for all customers and takes it down, removing the prop.
public TakeDown ( ) : void
return void