Game Development Reference
In-Depth Information
// and move to my hand
var card:Card=null;
card = removeCardIn(m_deck, cid);
if ( card != null )
m_myHand.push(card);
}
public function toOthers(cid:int):void {
// Remove from deck
// and move to others
var card:Card=null;
card = removeCardIn(m_deck, cid);
if ( card != null )
m_others.push(card);
}
public function toBottom(cid:int):void {
// move the card to the bottom
// of the deck.
// from either myHand or from others
var card:Card=null;
card = removeCardIn(m_myHand, cid);
if ( card == null )
card = removeCardIn(m_others, cid);
if ( card != null )
m_deck.push(card);
}
public function playCard(c:Card):void {
m_game.playCard(c);
}
}
}
We will see how the card distribution is implemented in the Multiplayer design
section of this chapter.
 
Search WWH ::




Custom Search