diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-15 14:19:06 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-11-15 14:19:29 +0100 |
commit | ff3f2c3d619479072780fa8311077ac2d35996e1 (patch) | |
tree | 85d442cc34d2045e3e228f09dc714ea6ddbd2c4d | |
parent | b2527a9eaa7082c50ce6230e79df88edbced9abb (diff) |
Changed Tile API.
-rw-r--r-- | common/tile.cpp | 7 | ||||
-rw-r--r-- | common/tile.h | 18 |
2 files changed, 14 insertions, 11 deletions
diff --git a/common/tile.cpp b/common/tile.cpp index bf39a4e..f5e1ee4 100644 --- a/common/tile.cpp +++ b/common/tile.cpp @@ -4,10 +4,11 @@ Tile::Tile() { } -Tile::Tile(Tile::Type t) : type(t) { +Tile::Tile(Tile::Type t, Tile::Flags f) : type(t), flags(f) { } -Tile::Tile(uint8_t b) : type((Type)b) { - +Tile::Tile(uint16_t w) { + type = Type(w & 0x00ff); + flags = Flags(w >> 8); } diff --git a/common/tile.h b/common/tile.h index 5dbf69d..6a57da3 100644 --- a/common/tile.h +++ b/common/tile.h @@ -13,7 +13,6 @@ class Tile { Man_2, Man_3, Man_4, - Man_5_red, Man_5, Man_6, Man_7, @@ -24,7 +23,6 @@ class Tile { Pin_2, Pin_3, Pin_4, - Pin_5_red, Pin_5, Pin_6, Pin_7, @@ -35,7 +33,6 @@ class Tile { Sou_2, Sou_3, Sou_4, - Sou_5_red, Sou_5, Sou_6, Sou_7, @@ -49,16 +46,21 @@ class Tile { // Dragons: Chun, Haku, - Hatsu, - // Flags: - Rotated = 0x40 + Hatsu + }; + + enum Flags { + None = 0x00, + Rotated = 0x01, + Red = 0x02 }; Type type; + Flags flags; Tile(); - Tile(Type t); - Tile(uint8_t b); + Tile(Type t, Flags f = None); + Tile(uint16_t w); }; #endif |