source: trunk/monsterz/board.h @ 664

Last change on this file since 664 was 664, checked in by sam, 9 years ago

Get rid of float3, float4, int3 etc. in favour of GLSL types.

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1//
2// Monsterz
3//
4// Copyright: (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
9//
10
11//
12// The Board class
13// ---------------
14//
15
16#if !defined __MONSTERZ_BOARD_H__
17#define __MONSTERZ_BOARD_H__
18
19#include "monsterz.h"
20
21class BoardData;
22
23class Board : public WorldEntity
24{
25public:
26    typedef enum
27    {
28        GAME_HUNT,
29        GAME_FUSION,
30    }
31    game_t;
32
33    Board(game_t, vec2i dim, int minnpieces, int maxnpieces);
34    virtual ~Board();
35
36    char const *GetName() { return "<board>"; }
37
38protected:
39    virtual void TickGame(float deltams);
40    virtual void TickDraw(float deltams);
41
42    /* Hunt mode */
43    void Fill();
44    void Switch(vec2i cell_a, vec2i cell_b);
45    int ListMashes(int list[MAX_WIDTH][MAX_HEIGHT]);
46    int ListMoves(int list[MAX_WIDTH][MAX_HEIGHT]);
47
48    /* Fusion mode */
49    int GetRandomId() const;
50    void Resolve();
51    int TagNeighbours(int list[MAX_PIECES][MAX_PIECES], int i, int j);
52
53private:
54    BoardData *data;
55};
56
57#endif // __MONSTERZ_BOARD_H__
58
Note: See TracBrowser for help on using the repository browser.