gecco.server.visibility
Class VisibilityManager

java.lang.Object
  |
  +--gecco.server.visibility.VisibilityManager

public class VisibilityManager
extends Object

Description of the Class

Author:
Karl Hasselström, Henrik Hägerström

Field Summary
private  AutomatonMap am
          Description of the Field
private  Client ci
          Description of the Field
private  String[] roles
          Description of the Field
private  UnitManager um
          Description of the Field
 
Constructor Summary
VisibilityManager(AutomatonMap am, Client ci, UnitManager um)
          Constructor for the VisibilityManager object
 
Method Summary
 boolean canSeeAutomaton(String role, int x, int y)
          Description of the Method
 boolean canSeeAutomaton(String role, int x, int y, Unit excludeUnit)
          Description of the Method
 boolean canSeePosition(String role, double x, double y)
          Description of the Method
 boolean canSeeUnit(String role, Unit unit, Unit excludeUnit)
          Description of the Method
 void deleteUnit(Unit unit, double lastKnownX, double lastKnownY)
          Description of the Method
static void main(String[] args)
          The main program for the VisibilityManager class
 void startGame(String role)
          Description of the Method
private  void startGodsEyeGame(String godsEyeRole)
          Description of the Method
 void updateAutomatonState(int x, int y, Color c)
          Description of the Method
 void updateUnitPosition(Unit unit, double oldX, double oldY, double newX, double newY)
          Description of the Method
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

roles

private String[] roles
Description of the Field

am

private AutomatonMap am
Description of the Field

ci

private Client ci
Description of the Field

um

private UnitManager um
Description of the Field
Constructor Detail

VisibilityManager

public VisibilityManager(AutomatonMap am,
                         Client ci,
                         UnitManager um)
Constructor for the VisibilityManager object
Parameters:
am - Description of Parameter
ci - Description of Parameter
um - Description of Parameter
Method Detail

canSeePosition

public boolean canSeePosition(String role,
                              double x,
                              double y)
Description of the Method
Parameters:
role - Description of Parameter
x - Description of Parameter
y - Description of Parameter
Returns:
Description of the Returned Value

updateAutomatonState

public void updateAutomatonState(int x,
                                 int y,
                                 Color c)
Description of the Method
Parameters:
x - Description of Parameter
y - Description of Parameter
c - Description of Parameter

canSeeAutomaton

public boolean canSeeAutomaton(String role,
                               int x,
                               int y,
                               Unit excludeUnit)
Description of the Method
Parameters:
role - Description of Parameter
x - Description of Parameter
y - Description of Parameter
excludeUnit - Description of Parameter
Returns:
Description of the Returned Value

canSeeAutomaton

public boolean canSeeAutomaton(String role,
                               int x,
                               int y)
Description of the Method
Parameters:
role - Description of Parameter
x - Description of Parameter
y - Description of Parameter
Returns:
Description of the Returned Value

canSeeUnit

public boolean canSeeUnit(String role,
                          Unit unit,
                          Unit excludeUnit)
Description of the Method
Parameters:
role - Description of Parameter
unit - Description of Parameter
excludeUnit - Description of Parameter
Returns:
Description of the Returned Value

updateUnitPosition

public void updateUnitPosition(Unit unit,
                               double oldX,
                               double oldY,
                               double newX,
                               double newY)
Description of the Method
Parameters:
unit - Description of Parameter
oldX - Description of Parameter
oldY - Description of Parameter
newX - Description of Parameter
newY - Description of Parameter

deleteUnit

public void deleteUnit(Unit unit,
                       double lastKnownX,
                       double lastKnownY)
Description of the Method
Parameters:
unit - Description of Parameter
lastKnownX - Description of Parameter
lastKnownY - Description of Parameter

startGame

public void startGame(String role)
Description of the Method
Parameters:
role - Description of Parameter

startGodsEyeGame

private void startGodsEyeGame(String godsEyeRole)
Description of the Method
Parameters:
godsEyeRole - Description of Parameter

main

public static void main(String[] args)
The main program for the VisibilityManager class
Parameters:
args - The command line arguments