Skip to content
Permalink
162cbc34c6
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
118 lines (79 sloc) 2.07 KB
package controller;
import view.*;
import model.*;
public class Cashflow
{
private GameBoard _board;
private Player[] _players;
//private CardStack[] _cards;
public static void go()
{
System.out.println("Start game");
// Joe
// Initialize game board
// Initialize GUI
// Initialize players (pick professions)
/*
* Start game:
* calls play function that has a
* while loop that repeats until either a player wins or
* someone elects to quit
*/
}
public void play()
{
while(!isWinner())
{
// TODO Play method
// Get player whose turn it is
// Display their financial statement
// Check down sized (check if player's down size counter is 0)
// Check charity (Check if charity counter is 0)
// Roll dice
// Move player (Have to wrap tiles to next tile after last tile is the beginning)
// Call tile's getLandedOn method
// Update current/all players' financials
// Increment player array (Also needs to wrap like tiles array)
}
}
public boolean isWinner()
{
boolean isWinner = false;
for(Player p : _players)
{
if(p.hasWon())
{
return true;
}
}
return isWinner;
}
private static void testGamePlay()
{
Player p1 = new Player();
Player p2 = new Player();
GameBoard g = new GameBoard(p1, p2);
System.out.println(p1.getLocation());
g.movePlayer(p1, 5);
System.out.println(p1.getLocation());
}
public static void testCards()
{
BigDealStack ms = new BigDealStack();
int initialSize = ms.getSize();
for(int i=0; i<initialSize; i++)
{
int num = i+1;
System.out.println(num + ": " + ms.get(i).getTitle()); //Always going to need this cast when getting description unfortunately
}
Card c1 = ms.pop();
Card c2 = ms.pop();
System.out.println("Just popped: " + c1.getTitle());
System.out.println("Just popped: " + c2.getTitle());
for(int i=0; i<initialSize; i++)
{
int num = i+1;
System.out.println(num + ": " + (ms.get(i).getTitle())); //Always going to need this cast when getting description unfortunately
}
}
}