J :
* Add a helper function.
This commit is contained in:
@@ -30,6 +30,8 @@ class ObjectSelector : public GuiLayer
|
|||||||
LimitorFunctor<T>* limitor;
|
LimitorFunctor<T>* limitor;
|
||||||
Pos bigpos;
|
Pos bigpos;
|
||||||
|
|
||||||
|
T* handLast; T* playLast;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ObjectSelector(DuelLayers*);
|
ObjectSelector(DuelLayers*);
|
||||||
void Add(T*);
|
void Add(T*);
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ class GuiHand : public GuiLayer
|
|||||||
GuiHand(CardSelector* cs, MTGHand* hand);
|
GuiHand(CardSelector* cs, MTGHand* hand);
|
||||||
~GuiHand();
|
~GuiHand();
|
||||||
void Update(float dt);
|
void Update(float dt);
|
||||||
|
bool isInHand(CardView*);
|
||||||
|
|
||||||
friend struct HandLimitor;
|
friend struct HandLimitor;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,9 +13,9 @@ const float GuiHand::ClosedX = 494;
|
|||||||
|
|
||||||
bool HandLimitor::select(Target* t)
|
bool HandLimitor::select(Target* t)
|
||||||
{
|
{
|
||||||
vector<CardView*>::iterator it;
|
if (CardView* c = dynamic_cast<CardView*>(t))
|
||||||
it = find(hand->cards.begin(), hand->cards.end(), t);
|
return hand->isInHand(c);
|
||||||
return (it != hand->cards.end());
|
else return false;
|
||||||
}
|
}
|
||||||
bool HandLimitor::greyout(Target* t)
|
bool HandLimitor::greyout(Target* t)
|
||||||
{
|
{
|
||||||
@@ -51,6 +51,13 @@ void GuiHand::Update(float dt)
|
|||||||
(*it)->Update(dt);
|
(*it)->Update(dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GuiHand::isInHand(CardView* card)
|
||||||
|
{
|
||||||
|
vector<CardView*>::iterator it;
|
||||||
|
it = find(cards.begin(), cards.end(), card);
|
||||||
|
return (it != cards.end());
|
||||||
|
}
|
||||||
|
|
||||||
GuiHandOpponent::GuiHandOpponent(CardSelector* cs, MTGHand* hand) : GuiHand(cs, hand) {}
|
GuiHandOpponent::GuiHandOpponent(CardSelector* cs, MTGHand* hand) : GuiHand(cs, hand) {}
|
||||||
|
|
||||||
void GuiHandOpponent::Render()
|
void GuiHandOpponent::Render()
|
||||||
|
|||||||
Reference in New Issue
Block a user