50 likes | 164 Views
MMTS Architectural Object-Oriented Design. MMTS. BankruptcyException. Entity. Bank. Space. GameController. Player. -List<Space> board -Player[] players. -List<Buyable> properties. -Player bankrupt -Player payee - int rentOwed. - int id - int money -Space position
E N D
MMTS BankruptcyException Entity Bank Space GameController Player -List<Space> board -Player[] players -List<Buyable> properties -Player bankrupt -Player payee -intrentOwed -int id -int money -Space position -Card outOfJailChance -Card outOfJailChest -void bankrupt() -void improve() +void pay(int amount) +void updatePosition(Space newPos) [See Later Slide] +playGame() +void pay(int amount) +void purchase() +void payRent(Entity payer, int amount) +int main(String[] args) Exception
Java.util.comparable Space Movement FreeParking IncomeTax GoToJail Rentable GetOutOfJail GroupRent Housable Mortgagable <<note>> <<note>> <<note>> Groupable +int houses +inthousePrice -Entity owner -int[] rent -intgroupSize -String group -boolean mortgage -name: String +land() +land() +land() +hasHotel() +improve(Player owner) +int disprove() +land() +land() +isMortgaged() +mortgage() +unMortgage() +compareTo() +land() +land() +land() +land() Go, Just Visiting, Luxury Tax, “Rent” Card Go to Jail Space and Card e.g. “Move to Boardwalk” Pass Go Rules Always Apply +land() <<note>> <<note>> Railways, Utilities Normal Properties
<<singleton>> <<singleton>> CommunityChestDeck ChanceDeck -cards: List<Space> -cards: List<Space> +shuffle() +draw() +remove() +insert() +shuffle() +draw() +remove() +insert() <<singleton>> Dice -Dice: Dice[] +getDice() +roll()
<<singleton>> Report -intmostMoneyHeld[] -inttotalNetIncome[] -inttotalGrossExpenses[] -inttotalNetWorth[] -inthighestGrossIncomeInTurn[] -inthighestGrossExpensesInTurn[] -intboardCounts[] -introundsPlayed[] -intpropertiesMortgaged; -intpropertiesUnmortgaged; -intrentsCollected[] -inttimesSentToJail[] -intchanceDrawn[] -intchestDrawn[] -List<Property> propertiesOwned[] -inthousesBought[]; -inthotelsbought[]; -intdoublesRolled[]; + void reset() + void generateReport() + void boughtProperty() + void assessedRent() + void assessedTax() + void purchasedHouse() + void purchasedHotel() + void purchasedProperty() + void mortgagedProperty() + void unmortgagedProperty() + void sentToJail(Player player) + void drewChance(Player player) + void drewCommunityChest(Player player) + void rolledDoubles(Player player)