ExchangingCharacter holds relevant information about character that is participating in exchange of items with another character.
More...
#include <exchangemanager.h>
|
| void | AdjustMoney (int coin, int delta) |
| | Change the amount of money this character is offering in the exchange. More...
|
| |
| void | AdjustMoney (const psMoney &amount) |
| |
| | ExchangingCharacter (int client, psCharacterInventory &inv) |
| |
| bool | GetExchangedItems (csString &text) |
| |
| psItem * | GetOfferedItem (int slot) |
| |
| psMoney | GetOfferedMoney () |
| |
| void | GetOffering (csString &buff) |
| | Constructs an XML list of the items that are being offered. More...
|
| |
| void | GetOfferingCSV (csString &buff) |
| |
| void | GetSimpleOffering (csString &buff, psCharacter *chr, bool exact=true) |
| | Constructs a simple XML list of the items that are being offered. More...
|
| |
| float | GetSumSize () |
| | Gets the total size of all the items that are offered. More...
|
| |
| float | GetSumWeight () |
| | Gets the total weight of all the items that are offered. More...
|
| |
| bool | IsOfferingSane () |
| | Make sure all offered items still have legal stack counts. More...
|
| |
| bool | MoveOfferedItem (int fromSlot, int stackcount, int toSlot) |
| |
| bool | OfferItem (int exchSlotNum, INVENTORY_SLOT_NUMBER invSlot, int stackcount, bool test) |
| | Inserts item to position 'itemNum'. More...
|
| |
| bool | RemoveItemFromOffer (int itemNum, int count, int &remain) |
| | Removes items from position 'itemNum'. More...
|
| |
| void | TransferMoney (int targetClientNum) |
| | Transfers the trias from this exchanging player to a different player. More...
|
| |
| void | TransferMoney (psCharacter *target) |
| | Transfers the trias from this exchanging player to another character. More...
|
| |
| void | TransferOffer (int targetClientNum) |
| | Transfers offered items and money to character 'target'. More...
|
| |
| void | TransferOffer (psCharacter *npc) |
| | Transfers offered items and money to an NPC 'npc'. More...
|
| |
| void | UpdateOfferingMoney () |
| | Update the money box for money that is being offered by this character. More...
|
| |
| void | UpdateReceivingMoney (psMoney &money) |
| | Update the money box for money that will be received by this character. More...
|
| |
ExchangingCharacter holds relevant information about character that is participating in exchange of items with another character.
Definition at line 54 of file exchangemanager.h.
| void ExchangingCharacter::AdjustMoney |
( |
int |
coin, |
|
|
int |
delta |
|
) |
| |
Change the amount of money this character is offering in the exchange.
- Parameters
-
| void ExchangingCharacter::AdjustMoney |
( |
const psMoney & |
amount | ) |
|
| bool ExchangingCharacter::GetExchangedItems |
( |
csString & |
text | ) |
|
| psItem* ExchangingCharacter::GetOfferedItem |
( |
int |
slot | ) |
|
| psMoney ExchangingCharacter::GetOfferedMoney |
( |
| ) |
|
|
inline |
| void ExchangingCharacter::GetOffering |
( |
csString & |
buff | ) |
|
Constructs an XML list of the items that are being offered.
The format of the xml is: <L MONEY=psMoney.ToString> <ITEM N=name SLT_POS=slotposition C=count WT=weight IMG=icon image> ... </L>
- Parameters
-
| buff | [CHANGES] Is where the resulting xml message is built. |
| void ExchangingCharacter::GetOfferingCSV |
( |
csString & |
buff | ) |
|
| void ExchangingCharacter::GetSimpleOffering |
( |
csString & |
buff, |
|
|
psCharacter * |
chr, |
|
|
bool |
exact = true |
|
) |
| |
Constructs a simple XML list of the items that are being offered.
The format of the xml is when exact: <L MONEY="psMoney.ToString"><ITEM N=name C=count Q=quality />...</L> else: <L MONEY="0,0,0,psMoney.GetTotal"><ITEM N=name C=count Q=quality />...</L>
- Parameters
-
| buff | [CHANGES] Is where the resulting xml message is built. |
| chr | The character |
| exact | Should the offer be exactly |
| float ExchangingCharacter::GetSumSize |
( |
| ) |
|
Gets the total size of all the items that are offered.
| float ExchangingCharacter::GetSumWeight |
( |
| ) |
|
Gets the total weight of all the items that are offered.
| bool ExchangingCharacter::IsOfferingSane |
( |
| ) |
|
Make sure all offered items still have legal stack counts.
| bool ExchangingCharacter::MoveOfferedItem |
( |
int |
fromSlot, |
|
|
int |
stackcount, |
|
|
int |
toSlot |
|
) |
| |
Inserts item to position 'itemNum'.
If there is another item at this position already, it tries to stack them.
- Returns
- -1 on failure otherwise the number of remaining items
| bool ExchangingCharacter::RemoveItemFromOffer |
( |
int |
itemNum, |
|
|
int |
count, |
|
|
int & |
remain |
|
) |
| |
Removes items from position 'itemNum'.
Can return NULL if there is no item. Returned item instance now belongs to caller.
- Parameters
-
| itemNum | The position to remove from. |
| count | Count=-1 means take everything. |
| remain | [CHANGES] The number of items left in the slot ( if any ) |
| void ExchangingCharacter::TransferMoney |
( |
int |
targetClientNum | ) |
|
Transfers the trias from this exchanging player to a different player.
- Parameters
-
| targetClientNum | The client id of the client that should be receiving this characters offering money. |
| void ExchangingCharacter::TransferMoney |
( |
psCharacter * |
target | ) |
|
Transfers the trias from this exchanging player to another character.
| void ExchangingCharacter::TransferOffer |
( |
int |
targetClientNum | ) |
|
Transfers offered items and money to character 'target'.
Target can be 0 - in this case everything is just destroyed.
| void ExchangingCharacter::TransferOffer |
( |
psCharacter * |
npc | ) |
|
Transfers offered items and money to an NPC 'npc'.
| void ExchangingCharacter::UpdateOfferingMoney |
( |
| ) |
|
Update the money box for money that is being offered by this character.
| void ExchangingCharacter::UpdateReceivingMoney |
( |
psMoney & |
money | ) |
|
Update the money box for money that will be received by this character.
| int ExchangingCharacter::client |
|
protected |
Stuff that was removed from character inventory and offered to the other character.
Definition at line 192 of file exchangemanager.h.
| psMoney ExchangingCharacter::offeringMoney |
The documentation for this class was generated from the following file: