Ignore:
Timestamp:
Jan 23, 2011, 2:21:03 PM (11 years ago)
Author:
sam
Message:

Mashes can now keep track of Pieces. Unused yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/monsterz/mash.cpp

    r259 r262  
    3030private:
    3131    Game *game;
     32    Piece *pieces[8 * 8];
     33    Int2 cells[8 * 8];
     34    int npieces;
    3235};
    3336
     
    3639 */
    3740
    38 Mash::Mash(Game *game, Int2 *cell)
     41Mash::Mash(Game *game)
    3942  : data(new MashData()),
    4043    nextmash(NULL)
     
    4245    data->game = game;
    4346    Ticker::Ref(game);
     47    data->npieces = 0;
     48}
     49
     50void Mash::AddPiece(Piece *piece)
     51{
     52    data->pieces[data->npieces] = piece;
     53    data->cells[data->npieces] = piece->GetCell();
     54    data->npieces++;
    4455}
    4556
Note: See TracChangeset for help on using the changeset viewer.