12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #include "ItemSkill.h"
- #include "Block.h"
- #include "Entity.h"
- #include "ItemType.h"
- ItemSkill::ItemSkill(float xp, float maxXp, float level)
- : Framework::ReferenceCounter(),
- xp(xp),
- maxXP(maxXp),
- level(level),
- itemTypeId(-1)
- {}
- void ItemSkill::load(Framework::StreamReader* zReader)
- {
- zReader->lese((char*)&xp, 4);
- zReader->lese((char*)&maxXP, 4);
- zReader->lese((char*)&level, 4);
- zReader->lese((char*)&itemTypeId, 4);
- }
- void ItemSkill::save(Framework::StreamWriter* zWriter)
- {
- zWriter->schreibe((char*)&xp, 4);
- zWriter->schreibe((char*)&maxXP, 4);
- zWriter->schreibe((char*)&level, 4);
- zWriter->schreibe((char*)&itemTypeId, 4);
- }
- bool ItemSkill::interact(Entity* zActor, Item* zUsedItem, Block* zTarget)
- {
- return zTarget->interact(zUsedItem, zActor);
- }
- bool ItemSkill::interact(Entity* zActor, Item* zUsedItem, Entity* zTarget)
- {
- return zTarget->interact(zUsedItem, zActor);
- }
- void ItemSkill::setXp(float xp)
- {
- this->xp = xp;
- }
- float ItemSkill::getXp() const
- {
- return xp;
- }
- void ItemSkill::setMaxXp(float maxXp)
- {
- this->maxXP = maxXp;
- }
- float ItemSkill::getMaxXp() const
- {
- return maxXP;
- }
- void ItemSkill::setLevel(float level)
- {
- this->level = level;
- }
- float ItemSkill::getLevel() const
- {
- return level;
- }
- void ItemSkill::setItemTypeId(int itemTypeId)
- {
- this->itemTypeId = itemTypeId;
- }
- int ItemSkill::getItemTypeId() const
- {
- return itemTypeId;
- }
|