All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.habanero.LimitPlayerLock
java.lang.Object
|
+----ncsa.habanero.Lock
|
+----ncsa.habanero.LimitPlayerLock
- public class LimitPlayerLock
- extends Lock
LimitPlayerLock - a limitation on the number of players to actively
participate in a session
-
LimitPlayerLock()
-
-
LimitPlayerLock(int)
-
requests a limit to the active participants
-
allows(Action)
-
This method is used when an action is being attempted.
-
consistent(Lock)
-
This routine is used to determine if this lock can coexist with this
older lock.
-
equals(Object)
-
Used to compare locks
-
getLimit()
-
returns the limit
-
keyWorksWith(Lock)
-
The user has the key to the current lock, is the lock still legal.
-
releaseAfterUsing()
-
Should this lock be released after it has been used only once
LimitPlayerLock
public LimitPlayerLock(int nRequestedLimit)
- requests a limit to the active participants
- Parameters:
- nRequestedLimit - the number of people to be allowed
- Returns:
- a lock that will request the maximum number of participants
LimitPlayerLock
public LimitPlayerLock()
- Returns:
- a player lock, one should be used for each participant in a game
getLimit
public int getLimit()
- returns the limit
- Returns:
- returns the limit
allows
public boolean allows(Action act)
- This method is used when an action is being attempted. It
checks to see if the action is allowed.
- Parameters:
- act - the action that is being attempted
- Returns:
- always returns false since a limit lock keeps additional
people from joining
- Overrides:
- allows in class Lock
consistent
public boolean consistent(Lock lkdRequest)
- This routine is used to determine if this lock can coexist with this
older lock.
- Parameters:
- lkdRequest - the other lock that is attempted
- Returns:
- true if someone else is asking for the same name or the same ID
- Overrides:
- consistent in class Lock
keyWorksWith
public boolean keyWorksWith(Lock ldRequest)
- The user has the key to the current lock, is the lock still legal.
- Parameters:
- ldRequest - the request that the user is making
- Returns:
- nothing works with this key
- Overrides:
- keyWorksWith in class Lock
releaseAfterUsing
public boolean releaseAfterUsing()
- Should this lock be released after it has been used only once
- Returns:
- once a player gets one of these, they have it as long as they want
- Overrides:
- releaseAfterUsing in class Lock
equals
public boolean equals(Object another)
- Used to compare locks
- Parameters:
- another - the other lock
- Returns:
- true if they have the same ID, or if one is missing an ID, then
the same name
- Overrides:
- equals in class Lock
All Packages Class Hierarchy This Package Previous Next Index