com.planet_ink.coffee_mud.Common
Class DefaultArrestWarrant

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultArrestWarrant
All Implemented Interfaces:
CMCommon, LegalWarrant, CMObject, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultArrestWarrant
extends java.lang.Object
implements LegalWarrant


Constructor Summary
DefaultArrestWarrant()
           
 
Method Summary
 void addPunishmentParm(int code, java.lang.String parm)
          If applicable, sets any parameters associated with a particular bitmask on the punishment.
 MOB arrestingOfficer()
          If the criminal has been identified by an otherwise unoccupied officer, this will be that officer.
 int compareTo(CMObject o)
           
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 java.lang.String crime()
          The crime name
 MOB criminal()
          The actual player/mob criminal accused of the crime.
 long getIgnoreUntilTime()
          Returns the real time in ms when the warrant can no longer be ignored
 long getLastStateChangeTime()
          Returns the real time in ms when the state last changed.
 java.lang.String getPunishmentParm(int code)
          If applicable, returns any parameters associated with a particular bitmask on the punishment.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 Room jail()
          Returns the room into which this criminal will be jailed.
 int jailTime()
          If applicable, returns the number of ticks the punishment calls for the criminal to remain in jail.
 long lastOffense()
          Returns the last time, in miliseconds since 1970, the criminal has committed this crime.
 java.lang.String name()
          The displayable name of this object.
 CMObject newInstance()
          Returns a new instance of this class.
 int offenses()
          Returns the number of times this criminal has done this crime.
 int punishment()
          Gets the full punishment code for the crime
 Room releaseRoom()
          Returns the room into which this criminal will be released after jail.
 void setArrestingOfficer(Area legalArea, MOB mob)
          If the criminal has been identified by an otherwise unoccupied officer, this will set that officer.
 void setCrime(java.lang.String newcrime)
          Sets the crime name
 void setCriminal(MOB mob)
          Sets the actual player/mob criminal accused of the crime.
 void setIgnoreUntilTime(long time)
          Sets the real time in ms when the warrant can no longer be ignored
 void setJail(Room R)
          Sets the room into which this criminal will be jailed.
 void setJailTime(int time)
          If applicable, sets the number of ticks the punishment calls for the criminal to remain in jail.
 void setLastOffense(long last)
          Sets the last time, in miliseconds since 1970, the criminal has committed this crime.
 void setOffenses(int num)
          Sets the number of times this criminal has done this crime.
 void setPunishment(int code)
          Sets the full punishment code for the crime
 void setReleaseRoom(Room R)
          Sets the room into which this criminal will be released after jail.
 void setState(int newstate)
          Sets the current state of adjudication.
 void setTravelAttemptTime(long time)
          Sets the time, in milis since 1970, that a trip to the judge or to the jail was started.
 void setVictim(MOB mob)
          If applicable, sets the victim of the crime (or null)
 void setWarnMsg(java.lang.String msg)
          Sets the warning message given to the criminal by the officer.
 void setWitness(MOB mob)
          If applicable, sets the witness of the crime (or null)
 int state()
          Returns the current state of adjudication.
 long travelAttemptTime()
          Returns the time, in milis since 1970, that a trip to the judge or to the jail was started.
 MOB victim()
          If applicable, the victim of the crime (or null)
 java.lang.String warnMsg()
          Returns the warning message given to the criminal by the officer.
 MOB witness()
          If applicable, gets the witness of the crime (or null)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultArrestWarrant

public DefaultArrestWarrant()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Returns:
the name of this class

name

public java.lang.String name()
Description copied from interface: CMObject
The displayable name of this object. May be modified by phyStats() object. Is derived from the Name().

Specified by:
name in interface CMObject
Returns:
the modified final name of this object on the map.
See Also:
Environmental.Name()

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

setArrestingOfficer

public void setArrestingOfficer(Area legalArea,
                                MOB mob)
Description copied from interface: LegalWarrant
If the criminal has been identified by an otherwise unoccupied officer, this will set that officer.

Specified by:
setArrestingOfficer in interface LegalWarrant
Parameters:
legalArea - the Area governing the law
mob - the actual living mob officer who will enforce the warrant
See Also:
LegalWarrant.arrestingOfficer()

criminal

public MOB criminal()
Description copied from interface: LegalWarrant
The actual player/mob criminal accused of the crime.

Specified by:
criminal in interface LegalWarrant
Returns:
the actual player/mob criminal accused of the crime.
See Also:
LegalWarrant.setCriminal(MOB)

victim

public MOB victim()
Description copied from interface: LegalWarrant
If applicable, the victim of the crime (or null)

Specified by:
victim in interface LegalWarrant
Returns:
the victim of the crime, or null
See Also:
LegalWarrant.setVictim(MOB)

witness

public MOB witness()
Description copied from interface: LegalWarrant
If applicable, gets the witness of the crime (or null)

Specified by:
witness in interface LegalWarrant
Returns:
the witness of the crime or null
See Also:
LegalWarrant.setWitness(MOB)

arrestingOfficer

public MOB arrestingOfficer()
Description copied from interface: LegalWarrant
If the criminal has been identified by an otherwise unoccupied officer, this will be that officer.

Specified by:
arrestingOfficer in interface LegalWarrant
Returns:
the actual living mob officer who will enforce the warrant
See Also:
LegalWarrant.setArrestingOfficer(Area, MOB)

jail

public Room jail()
Description copied from interface: LegalWarrant
Returns the room into which this criminal will be jailed.

Specified by:
jail in interface LegalWarrant
Returns:
the room into which this criminal will be jailed.
See Also:
LegalWarrant.setJail(Room)

releaseRoom

public Room releaseRoom()
Description copied from interface: LegalWarrant
Returns the room into which this criminal will be released after jail.

Specified by:
releaseRoom in interface LegalWarrant
Returns:
the room into which this criminal will be released after jail.
See Also:
LegalWarrant.setReleaseRoom(Room)

crime

public java.lang.String crime()
Description copied from interface: LegalWarrant
The crime name

Specified by:
crime in interface LegalWarrant
Returns:
the crime name
See Also:
LegalWarrant.setCrime(String), Law.BIT_CRIMENAME

punishment

public int punishment()
Description copied from interface: LegalWarrant
Gets the full punishment code for the crime

Specified by:
punishment in interface LegalWarrant
Returns:
the full punishment code for the crime
See Also:
LegalWarrant.setPunishment(int), LegalWarrant.getPunishmentParm(int), LegalWarrant.addPunishmentParm(int, String), Law.PUNISHMENT_DESCS, Law.PUNISHMENTMASK_DESCS

getPunishmentParm

public java.lang.String getPunishmentParm(int code)
Description copied from interface: LegalWarrant
If applicable, returns any parameters associated with a particular bitmask on the punishment.

Specified by:
getPunishmentParm in interface LegalWarrant
Parameters:
code - the punishment mask bitmap code
Returns:
any parameters needed, or null
See Also:
LegalWarrant.addPunishmentParm(int, String), LegalWarrant.punishment(), LegalWarrant.setPunishment(int), Law.PUNISHMENTMASK_DESCS

addPunishmentParm

public void addPunishmentParm(int code,
                              java.lang.String parm)
Description copied from interface: LegalWarrant
If applicable, sets any parameters associated with a particular bitmask on the punishment.

Specified by:
addPunishmentParm in interface LegalWarrant
Parameters:
code - the punishment mask bitmap code
parm - the parameter to set
See Also:
LegalWarrant.getPunishmentParm(int), LegalWarrant.punishment(), LegalWarrant.setPunishment(int), Law.PUNISHMENTMASK_DESCS

jailTime

public int jailTime()
Description copied from interface: LegalWarrant
If applicable, returns the number of ticks the punishment calls for the criminal to remain in jail.

Specified by:
jailTime in interface LegalWarrant
Returns:
the number of ticks to be jailed for
See Also:
LegalWarrant.setJailTime(int)

state

public int state()
Description copied from interface: LegalWarrant
Returns the current state of adjudication.

Specified by:
state in interface LegalWarrant
Returns:
the current state of adjudication
See Also:
LegalWarrant.setState(int), Law.STATE_ARRESTING, Law.STATE_SEEKING

offenses

public int offenses()
Description copied from interface: LegalWarrant
Returns the number of times this criminal has done this crime. This is usually 0 unless it also exists in the old warrants list.

Specified by:
offenses in interface LegalWarrant
Returns:
the number of times this criminal has committed this crime.
See Also:
LegalWarrant.setOffenses(int), Law.oldWarrants()

lastOffense

public long lastOffense()
Description copied from interface: LegalWarrant
Returns the last time, in miliseconds since 1970, the criminal has committed this crime. Very useful in oldWarrants

Specified by:
lastOffense in interface LegalWarrant
Returns:
the last time this crime was done, in milis
See Also:
LegalWarrant.setLastOffense(long), Law.oldWarrants()

travelAttemptTime

public long travelAttemptTime()
Description copied from interface: LegalWarrant
Returns the time, in milis since 1970, that a trip to the judge or to the jail was started. For housekeeping purposes.

Specified by:
travelAttemptTime in interface LegalWarrant
Returns:
the milis time since the trip began
See Also:
LegalWarrant.setTravelAttemptTime(long)

warnMsg

public java.lang.String warnMsg()
Description copied from interface: LegalWarrant
Returns the warning message given to the criminal by the officer.

Specified by:
warnMsg in interface LegalWarrant
Returns:
the warning msg given
See Also:
LegalWarrant.setWarnMsg(String)

setCriminal

public void setCriminal(MOB mob)
Description copied from interface: LegalWarrant
Sets the actual player/mob criminal accused of the crime.

Specified by:
setCriminal in interface LegalWarrant
Parameters:
mob - the actual player/mob criminal accused of the crime.
See Also:
LegalWarrant.criminal()

setVictim

public void setVictim(MOB mob)
Description copied from interface: LegalWarrant
If applicable, sets the victim of the crime (or null)

Specified by:
setVictim in interface LegalWarrant
Parameters:
mob - the victim of the crime, or null
See Also:
LegalWarrant.victim()

setWitness

public void setWitness(MOB mob)
Description copied from interface: LegalWarrant
If applicable, sets the witness of the crime (or null)

Specified by:
setWitness in interface LegalWarrant
Parameters:
mob - the witness of the crime (or null)
See Also:
LegalWarrant.witness()

setJail

public void setJail(Room R)
Description copied from interface: LegalWarrant
Sets the room into which this criminal will be jailed.

Specified by:
setJail in interface LegalWarrant
Parameters:
R - the room into which this criminal will be jailed.
See Also:
LegalWarrant.jail()

setReleaseRoom

public void setReleaseRoom(Room R)
Description copied from interface: LegalWarrant
Sets the room into which this criminal will be released after jail.

Specified by:
setReleaseRoom in interface LegalWarrant
Parameters:
R - the room into which this criminal will be released after jail.
See Also:
LegalWarrant.releaseRoom()

setCrime

public void setCrime(java.lang.String newcrime)
Description copied from interface: LegalWarrant
Sets the crime name

Specified by:
setCrime in interface LegalWarrant
Parameters:
newcrime - the crime name
See Also:
LegalWarrant.crime(), Law.BIT_CRIMENAME

setPunishment

public void setPunishment(int code)
Description copied from interface: LegalWarrant
Sets the full punishment code for the crime

Specified by:
setPunishment in interface LegalWarrant
Parameters:
code - the full punishment code for the crime
See Also:
LegalWarrant.punishment(), LegalWarrant.getPunishmentParm(int), LegalWarrant.addPunishmentParm(int, String), Law.PUNISHMENT_DESCS, Law.PUNISHMENTMASK_DESCS

setJailTime

public void setJailTime(int time)
Description copied from interface: LegalWarrant
If applicable, sets the number of ticks the punishment calls for the criminal to remain in jail.

Specified by:
setJailTime in interface LegalWarrant
Parameters:
time - the number of ticks to be jailed for
See Also:
LegalWarrant.jailTime()

setState

public void setState(int newstate)
Description copied from interface: LegalWarrant
Sets the current state of adjudication.

Specified by:
setState in interface LegalWarrant
Parameters:
newstate - the current state of adjudication.
See Also:
LegalWarrant.state(), LegalWarrant.getLastStateChangeTime(), Law.STATE_DETAINING, Law.STATE_EXECUTING

getLastStateChangeTime

public long getLastStateChangeTime()
Description copied from interface: LegalWarrant
Returns the real time in ms when the state last changed.

Specified by:
getLastStateChangeTime in interface LegalWarrant
Returns:
the real time in ms when the state last changed.
See Also:
LegalWarrant.setState(int)

setOffenses

public void setOffenses(int num)
Description copied from interface: LegalWarrant
Sets the number of times this criminal has done this crime. This is usually 0 unless it also exists in the old warrants list.

Specified by:
setOffenses in interface LegalWarrant
Parameters:
num - the number of times this criminal has committed this crime.
See Also:
LegalWarrant.offenses(), Law.oldWarrants()

setLastOffense

public void setLastOffense(long last)
Description copied from interface: LegalWarrant
Sets the last time, in miliseconds since 1970, the criminal has committed this crime. Very useful in oldWarrants

Specified by:
setLastOffense in interface LegalWarrant
Parameters:
last - the last time this crime was done, in milis
See Also:
LegalWarrant.lastOffense(), Law.oldWarrants()

setTravelAttemptTime

public void setTravelAttemptTime(long time)
Description copied from interface: LegalWarrant
Sets the time, in milis since 1970, that a trip to the judge or to the jail was started. For housekeeping purposes.

Specified by:
setTravelAttemptTime in interface LegalWarrant
Parameters:
time - the milis time since the trip began
See Also:
LegalWarrant.travelAttemptTime()

setWarnMsg

public void setWarnMsg(java.lang.String msg)
Description copied from interface: LegalWarrant
Sets the warning message given to the criminal by the officer.

Specified by:
setWarnMsg in interface LegalWarrant
Parameters:
msg - the warning msg given
See Also:
LegalWarrant.warnMsg()

getIgnoreUntilTime

public long getIgnoreUntilTime()
Description copied from interface: LegalWarrant
Returns the real time in ms when the warrant can no longer be ignored

Specified by:
getIgnoreUntilTime in interface LegalWarrant
Returns:
the real time in ms when the warrant can no longer be ignored
See Also:
LegalWarrant.setIgnoreUntilTime(long)

setIgnoreUntilTime

public void setIgnoreUntilTime(long time)
Description copied from interface: LegalWarrant
Sets the real time in ms when the warrant can no longer be ignored

Specified by:
setIgnoreUntilTime in interface LegalWarrant
Parameters:
time - the real time in ms when the warrant can no longer be ignored
See Also:
LegalWarrant.getIgnoreUntilTime()