コード例 #1
0
 public void RemoveCard(TCGClient.Data.Models.CardType type, int id)
 {
     if (_gameCards[id].CardType == type)
     {
         _gameCards.RemoveAt(id);
     }
 }
コード例 #2
0
 public void ModifyCard(TCGClient.Data.Models.CardType searchType, int id, TCGClient.Data.Models.CardType newType)
 {
     for (int i = 0; i < _gameCards.Count; i++)
     {
         if (_gameCards[i].CardType == searchType && _gameCards[i].ID == id)
         {
             _gameCards[i].CardType = newType;
             return;
         }
     }
 }
コード例 #3
0
 public void RemoveAllCards(TCGClient.Data.Models.CardType type)
 {
     for (int i = 0; i < _gameCards.Count; i++)
     {
         if (_gameCards[i].CardType == type)
         {
             _gameCards.RemoveAt(i);
             i--;
         }
     }
 }
コード例 #4
0
 public void AddCard(TCGClient.Data.Models.CardType type, int x, int y, int id)
 {
     _gameCards.Add(new Card()
     {
         CardType = type,
         Left     = x,
         Top      = y,
         Width    = (int)Data.Models.Card.CardWidth,
         Height   = (int)Data.Models.Card.CardHeight,
         ID       = id
     });
 }