A small C# helperclass for boardgame-applications: allowable moves
10/22/2010
Leave a comment
Our students are creating classic boardgames using Silverlight. A problem that kept occurring was the following: “A player throws a certain number with the dice. How do I know, given his current location on the board, to which squares on the board the player is allowed to move to”.
I’ve written a small utility class that can be (re)used for simple applications where you have 2-dimensional map with certain squares on which the player can stand, and other not.
You can download the project here. Feel free to reuse/adapt. I’ve included to demo-usages.
boardgame, c#, code, helper class, List
