Planeshift
|
00001 /* 00002 * slotmanager.h 00003 * 00004 * Copyright (C) 2002 Atomic Blue ([email protected], http://www.atomicblue.org) 00005 * 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation (version 2 of the License) 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 * 00018 */ 00019 #ifndef __SLOTMANAGER_H__ 00020 #define __SLOTMANAGER_H__ 00021 00022 //============================================================================= 00023 // Crystal Space Includes 00024 //============================================================================= 00025 00026 //============================================================================= 00027 // Project Includes 00028 //============================================================================= 00029 00030 //============================================================================= 00031 // Local Includes 00032 //============================================================================= 00033 #include "msgmanager.h" 00034 00040 class SlotManager : public MessageManager<SlotManager> 00041 { 00042 public: 00043 SlotManager(GEMSupervisor* gemsupervisor, CacheManager* cachemanager); 00044 virtual ~SlotManager(); 00045 00046 bool Initialize(); 00047 00048 psItem* FindItem(Client* client, int containerID, INVENTORY_SLOT_NUMBER slotID); 00049 00050 private: 00051 00053 void HandleDropCommand(MsgEntry* me, Client* client); 00054 void HandleSlotMovement(MsgEntry* me, Client* client); 00055 00062 psItem* MakeMoneyItem(INVENTORY_SLOT_NUMBER slot, int stackCount); 00063 00065 void MoveFromInventory(psSlotMovementMsg &msg, Client* fromClient); 00066 00068 void MoveFromOffering(psSlotMovementMsg &msg, Client* fromClient); 00069 00071 void MoveFromOfferedMoney(psSlotMovementMsg &msg, Client* fromClient); 00072 00074 void MoveFromMoney(psSlotMovementMsg &msg, Client* fromClient); 00075 00077 void MoveFromWorldContainer(psSlotMovementMsg &msg, Client* fromClient, uint32 containerEntityID); 00078 00080 void Consume(psItem* item, psCharacter* charData, int count); 00081 00082 GEMSupervisor* gemSupervisor; 00083 CacheManager* cacheManager; 00084 MathScript* qualityScript; 00085 }; 00086 00087 #endif