From: Brett L. <wak...@ea...> - 2005-12-15 22:52:54
|
I've just committed some changes to the Token API so that now station size checking is done in Station.addToken(). I've also updated the TokenHolderI interface so that the addToken() method now returns a boolean. Use this for checking whether adding a token was successful. To address Erik's newly added comment in HexMap.mouseClicked(): // DROP A TOKEN - HOW? Playing tokens is a 2 step process: 1. Call the addToken() method for the Hex's Station 2. Call the company's addToken() method to add the current maphex to the company's token list. The reason it's a two step process is because, in the future when we need to do route calculation, it'll be vastly easier/quicker to get a list of where each company's tokens are from the company rather than having to scan every hex on the map for them. Removing tokens is similar: 1. remove the company object from the hex's station's token list 2. remove the hex object from the company's token list. ---Brett. |