00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00030 #if !defined(Slot_h)
00031 #define Slot_h
00032
00033 class TiXmlNode;
00034 #include "Component.h"
00035
00042 class Slot {
00043 public:
00044 Slot(const Component * comp, long amount, long Pos, const Slot & hull) : Allowed(0), component(comp), count(amount), mPosition(Pos), mSlotLeft(hull.mSlotLeft), mSlotTop(hull.mSlotTop) {}
00045
00046 Slot(const TiXmlNode * node, long Pos);
00047 Slot(const Slot & other) : Allowed(other.Allowed), component(other.component), count(other.count), mPosition(other.mPosition), mSlotLeft(other.mSlotLeft), mSlotTop(other.mSlotTop) {}
00048
00049 const Component * GetComp() const { return component; }
00050 bool IsAllowed(ComponentType type) const { return type & Allowed ? true : false; }
00051 int GetCount() const { return count; }
00052 long GetPosition() const { return mPosition; }
00053
00054 void SetComp(const Component * comp) { component = comp; }
00055
00056 friend bool operator==(const Slot & s1, const Slot & s2);
00057 friend bool operator!=(const Slot & s1, const Slot & s2) { return !(s1 == s2); }
00058
00059 private:
00060 ComponentType Allowed;
00061 const Component * component;
00062 long count;
00063 long mPosition;
00064 long mSlotLeft;
00065 long mSlotTop;
00066 };
00067
00068 #endif // !defined(Slot_h)