Changeset 262


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

Mashes can now keep track of Pieces. Unused yet.

Location:
trunk/monsterz
Files:
2 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
  • trunk/monsterz/mash.h

    r259 r262  
    1414#include "entity.h"
    1515#include "game.h"
     16#include "piece.h"
    1617
    1718class MashData;
     
    2021{
    2122public:
    22     Mash(Game *game, Int2 *cell);
     23    Mash(Game *game);
    2324    virtual ~Mash();
     25
     26    void AddPiece(Piece *piece);
    2427
    2528protected:
Note: See TracChangeset for help on using the changeset viewer.