Planeshift

pawsmoney.h

Go to the documentation of this file.
00001 /*
00002  * pawsmoney.h - Author: Ondrej Hurt
00003  *
00004  * Copyright (C) 2003 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 
00020 
00021 #ifndef PAWS_MONEY_HEADER
00022 #define PAWS_MONEY_HEADER
00023 
00024 #include <csutil/list.h>
00025 #include <iutil/document.h>
00026 #include "paws/pawswidget.h"
00027 #include "net/subscriber.h"
00028 #include "gui/inventorywindow.h"
00029 #include "pawsslot.h"
00030 
00036 class pawsMoney : public pawsWidget
00037 {
00038 public:
00039     pawsMoney();
00040 
00041     //from pawsWidget:
00042     virtual bool Setup(iDocumentNode * node);
00043     virtual bool PostSetup();
00044 
00046     void Set(int circles, int octas, int hexas, int trias);
00047     void Set(int coinType, int count);
00048     void Set(const psMoney & money);
00049     void Get(int & circles, int & octas, int & hexas, int & trias);
00050     int  Get(int coinType);
00051 
00053     int  GetAmount() { return amount; }
00054 
00055     psMoney Get();
00056 
00058     bool IsNoAmount();
00059 
00060     void SetContainer( int containerID );
00061     void Drag( bool dragOn );
00062 
00063     void Draw();
00064     void OnUpdateData(const char *dataname,PAWSData& value);
00065 
00066 protected:
00068     bool CreateGUI();
00069 
00070     bool border;    
00071     int spacing;    
00072 
00073     int amount;     
00074 
00075     pawsSlot * circles;
00076     pawsSlot * octas;
00077     pawsSlot * hexas;
00078     pawsSlot * trias;
00079 
00081     void RecalculateAmount();
00082 };
00083 
00084 CREATE_PAWS_FACTORY(pawsMoney);
00085 
00086 #endif
00087