Planeshift

psattackqueue.h

Go to the documentation of this file.
00001  /*
00002  * psattackqueue.cpp              creator [email protected]
00003  *
00004  * Copyright (C) 2001-2011 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 psAttackQueue_HEADER
00020 #define psAttackQueue_HEADER
00021 
00022 
00023 //====================================================================================
00024 // Crystal Space Includes
00025 //====================================================================================
00026 #include <csutil/csstring.h>
00027 #include <csutil/list.h>
00028 
00029 //====================================================================================
00030 // Project Includes
00031 //====================================================================================
00032 #include <idal.h>
00033 #include "psattack.h"
00034 
00041 class psAttackQueue : public csRefCount
00042 {
00043 public:
00044 
00045     /*
00046      * Constructor
00047      */
00048     psAttackQueue(psCharacter* pschar);
00049 
00050     /*
00051      * Pushes attack into the last slot of the queue.
00052      * @param attack the attack to push into the last slot of the queue
00053      */
00054     bool Push(psAttack* attack);
00055 
00056     /*
00057      * Removes the first slot in the queue.
00058      */
00059     bool Pop();
00060 
00061     /*
00062      * Returns the first slot in the queue without removing it.
00063      */
00064     psAttack* First();
00065 
00066     /*
00067      * Discards all items in the queue.
00068      */
00069     void Purge();
00070 
00071     /*
00072      * Returns the list of special attacks in the queue.
00073      */
00074     csList< csRef<psAttack> >& getAttackList();
00075 
00076     /*
00077      * Returns the number of special attacks in the queue.
00078      */
00079     size_t getAttackListCount();
00080 
00081 private:
00082     csList< csRef<psAttack> > attackList; 
00083     psCharacter* character;
00084 };
00085 #endif