battlehex.model.map
Interface IMoney

All Known Implementing Classes:
Money

public interface IMoney

Defines money management operations.

Version:
$Revision: 1.4 $ $Date: 2005/08/26 18:10:08 $
Author:
Mathieu Champlon

Method Summary
 void accept(IMoneyVisitor visitor)
          Retrieve territory information.
 void add(IMoney money)
          Add the given money.
 boolean buy(int amount)
          Decrease the amount for the current fundings.
 boolean canAfford(int amount)
          Test if a buy can be afforded.
 void pay(int amount)
          Credit the given amount.
 void reset()
          Reset the amounts to zero.
 

Method Detail

pay

public void pay(int amount)
Credit the given amount.

Parameters:
amount - the amount

canAfford

public boolean canAfford(int amount)
Test if a buy can be afforded.

Parameters:
amount - the amount
Returns:
whether the amount can be decreased from the current available money.

buy

public boolean buy(int amount)
Decrease the amount for the current fundings.

This operation should fail of it cannot be afforded.

Parameters:
amount - the amount to decrease
Returns:
whether the territory was able to afford the buy

accept

public void accept(IMoneyVisitor visitor)
Retrieve territory information.

Parameters:
visitor - the visitor

add

public void add(IMoney money)
Add the given money.

Parameters:
money - the money to add

reset

public void reset()
Reset the amounts to zero.



Copyright © 2004-2005 . All Rights Reserved.