Hello. I am making a computer version of the boardgame Thud!, although I guess this will apply to any generic boardgame. I have made boardgames in the past, but would like some advice on what would be good design, especially OOP design that I'm relatively new to.
http://en.wikipedia.org/wiki/Thud_%28game%29
Rather than me reiterate the article, have a quick look. You only really need to read the gameplay section.
My current idea is to create a board type that has a 2d array of cell types. Each cell type has a piece field, and a boolean value for whether or not there is a piece.
Assuming that's right, here's the piece type. My procedural blood tells me that the piece type should have a piecetype field which holds a constant. Dwarf could be 1, troll 2, 3 for thudstone and 4 for corner. (If only Blitz had enums)
My OOP senses are tingling that perhaps I should have dwarf, troll, thudstone and corner types that extend from piece. But I'm not sure how these would tell the game what type they are, other than returning a whatis function constant number. But that's just a long way of doing the above.
So any ideas?
http://en.wikipedia.org/wiki/Thud_%28game%29
Rather than me reiterate the article, have a quick look. You only really need to read the gameplay section.
My current idea is to create a board type that has a 2d array of cell types. Each cell type has a piece field, and a boolean value for whether or not there is a piece.
Assuming that's right, here's the piece type. My procedural blood tells me that the piece type should have a piecetype field which holds a constant. Dwarf could be 1, troll 2, 3 for thudstone and 4 for corner. (If only Blitz had enums)
My OOP senses are tingling that perhaps I should have dwarf, troll, thudstone and corner types that extend from piece. But I'm not sure how these would tell the game what type they are, other than returning a whatis function constant number. But that's just a long way of doing the above.
So any ideas?