CMObject
, Tickable
, CMLibrary
, LegalLibrary
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class MUDLaw extends StdLibrary implements LegalLibrary
idConverter
INDOORSTR, OUTDOORSTR, RENTSTR, SALESTR
isDebugging, name, serviceClient, tickStatus
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
MUDLaw() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
canAttackThisProperty(MOB mob,
PrivateProperty record) |
Property can be attacked if it is unowned, owned by the attacker,
is owned by a clan whose leader the attacker may fight, or owned
by a person whom the attacker may fight.
|
void |
colorRoomForSale(Room R,
LandTitle title,
boolean reset) |
If the given room with the given land title was recently
created, or recently lost its owner and has gone back into
a for-sale state, then this method will update or create
its ID and fix its title and description.
|
boolean |
doesAnyoneHavePrivilegesHere(MOB mob,
java.lang.String overrideID,
Room R) |
Returns whether the given mob, or an optional given property owner,
or literally anyone else in the room, has normal privileges in the
room.
|
protected boolean |
doesHaveClanFriendlyPrivilegesHere(MOB mob,
java.lang.String clanID) |
|
boolean |
doesHavePriviledgesHere(MOB mob,
Room room) |
A mob has normal privileges with record to property if they are the owner, married
to the owner, has HOME_PRIVS clan privileges with clan owned property, or with the
property of a clan that your clan is friendly with.
|
boolean |
doesHavePriviledgesInThisDirection(MOB mob,
Room room,
Exit exit) |
Given a mob, a room the mob is currently in, and an exit in that room that
the mob would enter, this will return whether the given mob has normal
privileges in the room in the direction of the exit.
|
boolean |
doesHavePrivilegesWith(MOB mob,
PrivateProperty record) |
A mob has normal privileges with record to property if they are the owner, married
to the owner, has HOME_PRIVS clan privileges with clan owned property, or with the
property of a clan that your clan is friendly with.
|
boolean |
doesHaveWeakPriviledgesHere(MOB mob,
Room room) |
Weak privileges are had when one owns a room, is married to the
owner, is following someone who is an owner, or is a member of
the clan that owns the property (privileges notwithstanding).
|
boolean |
doesHaveWeakPrivilegesWith(MOB mob,
PrivateProperty record) |
Weak privileges are had when one owns property, is married to the
owner, or is a member of the clan that owns the property
(privileges notwithstanding).
|
boolean |
doesOwnThisLand(MOB mob,
Room room) |
Someone is considered the owner if they are the named owner, married
to the named owner, with property ownership privileges to clan owned
property, or are Following someone who is otherwise an owner of some
sort.
|
boolean |
doesOwnThisProperty(MOB mob,
PrivateProperty record) |
Someone is considered the owner if they are the named owner, married
to the named owner, with property ownership privileges to clan owned
property, or are Following someone who is otherwise an owner of some
sort.
|
boolean |
doesOwnThisProperty(MOB mob,
Room room) |
Someone is considered the owner if they are the named owner, married
to the named owner, with property ownership privileges to clan owned
property, or are Following someone who is otherwise an owner of some
sort.
|
protected java.util.List<Room> |
getAllMetroTitledRooms(Area A) |
|
java.util.List<LandTitle> |
getAllUniqueLandTitles(Area A,
java.lang.String owner,
boolean includeRentals) |
Scans the given area metro for property titles, returning only the
unique ones (so rooms groups under one title return only the 1 title).
|
java.lang.String |
getClericInfused(Physical P) |
Cleric Infusion is actually more a part of Divine Law
than the normal kind.
|
Deity.DeityWorshipper |
getClericInfusion(Physical P) |
Cleric Infusion is actually more a part of Divine Law
than the normal kind.
|
java.util.Set<Room> |
getHomePeersOnThisFloor(Room room,
java.util.Set<Room> doneRooms) |
Returns all interconnected rooms that are private
property and ownable, even if owned by no one.
|
java.lang.String |
getLandOwnerName(Room room) |
Returns the name of the owner of the given room.
|
LandTitle |
getLandTitle(Area area) |
Returns the private property record of the given area,
if one exists.
|
LandTitle |
getLandTitle(Room room) |
Returns the private property record of the given room,
if one exists, or its area.
|
LegalBehavior |
getLegalBehavior(Area A) |
If an area is subject to law and order,
this method will return the legal system that
applies to it.
|
LegalBehavior |
getLegalBehavior(Room R) |
If a room is in an area subject to law and order,
this method will return the legal system that
applies to it.
|
Area |
getLegalObject(Area A) |
If an area is subject to law and order,
this method will return the exact area object
that the legal system directly applies to.
|
Area |
getLegalObject(Room R) |
If a room is in an area subject to law and order,
this method will return the exact area object
that the legal system directly applies to.
|
MOB |
getPropertyOwner(PrivateProperty record) |
If the owner of the given property record is a clan, this will return
the property owner mob.
|
java.lang.String |
getPropertyOwnerName(Room room) |
Returns the name of the owner of the given room.
|
PrivateProperty |
getPropertyRecord(Area area) |
Returns the private property record of the given area,
if one existsa.
|
PrivateProperty |
getPropertyRecord(Item item) |
Returns the private property record of the given item,
if one exists.
|
PrivateProperty |
getPropertyRecord(Room room) |
Returns the private property record of the given room,
if one exists, or its area.
|
PrivateProperty |
getPropertyRecord(MOB mob) |
Returns the private property record of the given mob,
if one exists.
|
Law |
getTheLaw(Room R) |
If a room is in an area subject to law and order,
this method will return the legal policy object that
applies to it.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
LandTitle |
ifHomePeerLandTitle(Room R) |
|
LandTitle |
ifLandTitle(Room R) |
|
boolean |
isACity(Area A) |
Returns whether the stats for the given area reflect
that it is legally considered a City.
|
boolean |
isHomePeerRoom(Room R) |
|
boolean |
isHomeRoomDownstairs(Room room) |
Given a room that is presumably a piece of property, this will return
whether the given room is downstairs (not necc directly) of property
rooms, even if owned by someone else.
|
boolean |
isHomeRoomUpstairs(Room room) |
Given a room that is presumably a piece of property, this will return
whether the given room is upstairs (not necc directly) of property
rooms, even if owned by someone else.
|
boolean |
isLandOwnable(Room room) |
Returns whether the given room has a land
title that makes it possible to own, which
might include the area.
|
boolean |
isLandOwnersName(java.lang.String name,
Room room) |
Someone is considered the direct owner if they are the named owner.
|
boolean |
isLegalJudgeHere(MOB mob) |
Returns whether the given mob is legally considered
a Judge in the place where the mob is presently
located when this method is called.
|
boolean |
isLegalOfficerHere(MOB mob) |
Returns whether the given mob is legally considered
a Police Officer in the place where the mob is presently
located when this method is called.
|
boolean |
isLegalOfficialHere(MOB mob) |
Returns whether the given mob is either a police
officer or a judge in the place where the mob is
presently located when this is called.
|
boolean |
isPropertyOwnersName(java.lang.String name,
Room room) |
Someone is considered the direct owner if they are the named owner.
|
boolean |
isRoomSimilarlyTitled(LandTitle title,
Room R) |
Given a title with an owner, this will return whether
the given room, or any room adjacent to the given room,
is owned by the same owner.
|
boolean |
mayOwnThisItem(MOB mob,
Item item) |
Given a mob and an item, this will return whether the mob
has weak privileges with a property record on the item.
|
boolean |
robberyCheck(PrivateProperty record,
CMMsg msg,
boolean quiet) |
This method is called whenever an action occurs on private property to
determine whether the action might start a "robbery" state.
|
protected boolean |
shopkeeperMobPresent(Room R) |
activate, getServiceClient, L, propertiesLoaded, shutdown
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
activate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, shutdown, tick
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
public Law getTheLaw(Room R)
LegalLibrary
getTheLaw
in interface LegalLibrary
R
- the room to checkLegalLibrary.getLegalObject(Area)
,
LegalLibrary.getLegalBehavior(Area)
,
LegalLibrary.getLegalObject(Room)
,
LegalLibrary.getLegalBehavior(Room)
public LegalBehavior getLegalBehavior(Area A)
LegalLibrary
getLegalBehavior
in interface LegalLibrary
A
- the area to checkLegalLibrary.getTheLaw(Room)
,
LegalLibrary.getLegalObject(Area)
,
LegalLibrary.getLegalObject(Room)
,
LegalLibrary.getLegalBehavior(Room)
public LegalBehavior getLegalBehavior(Room R)
LegalLibrary
getLegalBehavior
in interface LegalLibrary
R
- the room to checkLegalLibrary.getTheLaw(Room)
,
LegalLibrary.getLegalObject(Area)
,
LegalLibrary.getLegalBehavior(Area)
,
LegalLibrary.getLegalObject(Room)
public Area getLegalObject(Area A)
LegalLibrary
getLegalObject
in interface LegalLibrary
A
- the area to checkLegalLibrary.getTheLaw(Room)
,
LegalLibrary.getLegalBehavior(Area)
,
LegalLibrary.getLegalObject(Room)
,
LegalLibrary.getLegalBehavior(Room)
public Area getLegalObject(Room R)
LegalLibrary
getLegalObject
in interface LegalLibrary
R
- the room to checkLegalLibrary.getTheLaw(Room)
,
LegalLibrary.getLegalObject(Area)
,
LegalLibrary.getLegalBehavior(Area)
,
LegalLibrary.getLegalBehavior(Room)
public boolean isACity(Area A)
LegalLibrary
isACity
in interface LegalLibrary
A
- the area to checkpublic java.util.List<LandTitle> getAllUniqueLandTitles(Area A, java.lang.String owner, boolean includeRentals)
LegalLibrary
getAllUniqueLandTitles
in interface LegalLibrary
A
- the area whose rooms and children to scan for titlesowner
- null for all titles, * for all owned titles, or owner nameincludeRentals
- true to include rental property, false otherwisepublic LandTitle getLandTitle(Area area)
LegalLibrary
getLandTitle
in interface LegalLibrary
area
- the area to checkLegalLibrary.getPropertyRecord(Room)
,
LegalLibrary.getPropertyRecord(Area)
,
LegalLibrary.getPropertyRecord(Item)
,
LegalLibrary.getPropertyRecord(MOB)
,
LegalLibrary.getLandTitle(Room)
public PrivateProperty getPropertyRecord(Area area)
LegalLibrary
getPropertyRecord
in interface LegalLibrary
area
- the area to checkLegalLibrary.getPropertyRecord(Room)
,
LegalLibrary.getPropertyRecord(Item)
,
LegalLibrary.getPropertyRecord(MOB)
,
LegalLibrary.getLandTitle(Area)
,
LegalLibrary.getLandTitle(Room)
public PrivateProperty getPropertyRecord(MOB mob)
LegalLibrary
getPropertyRecord
in interface LegalLibrary
mob
- the mob to checkLegalLibrary.getPropertyRecord(Room)
,
LegalLibrary.getPropertyRecord(Item)
,
LegalLibrary.getPropertyRecord(Area)
,
LegalLibrary.getLandTitle(Area)
,
LegalLibrary.getLandTitle(Room)
public LandTitle getLandTitle(Room room)
LegalLibrary
getLandTitle
in interface LegalLibrary
room
- the room to checkLegalLibrary.getPropertyRecord(Room)
,
LegalLibrary.getPropertyRecord(Area)
,
LegalLibrary.getPropertyRecord(Item)
,
LegalLibrary.getPropertyRecord(MOB)
,
LegalLibrary.getLandTitle(Area)
public PrivateProperty getPropertyRecord(Room room)
LegalLibrary
getPropertyRecord
in interface LegalLibrary
room
- the room to checkLegalLibrary.getPropertyRecord(Area)
,
LegalLibrary.getPropertyRecord(Item)
,
LegalLibrary.getPropertyRecord(MOB)
,
LegalLibrary.getLandTitle(Area)
,
LegalLibrary.getLandTitle(Room)
public boolean isHomeRoomUpstairs(Room room)
LegalLibrary
isHomeRoomUpstairs
in interface LegalLibrary
room
- the room to check whether it is upstairsLegalLibrary.isHomeRoomDownstairs(Room)
,
LegalLibrary.getHomePeersOnThisFloor(Room, Set)
public boolean isHomePeerRoom(Room R)
public boolean isRoomSimilarlyTitled(LandTitle title, Room R)
LegalLibrary
isRoomSimilarlyTitled
in interface LegalLibrary
title
- the title to serve as basisR
- the room to start checking frompublic java.util.Set<Room> getHomePeersOnThisFloor(Room room, java.util.Set<Room> doneRooms)
LegalLibrary
getHomePeersOnThisFloor
in interface LegalLibrary
room
- the room to checkdoneRooms
- a required set to put all peer rooms inLegalLibrary.isHomeRoomUpstairs(Room)
,
LegalLibrary.isHomeRoomDownstairs(Room)
public boolean isHomeRoomDownstairs(Room room)
LegalLibrary
isHomeRoomDownstairs
in interface LegalLibrary
room
- the room to check whether it is downstairsLegalLibrary.isHomeRoomUpstairs(Room)
,
LegalLibrary.getHomePeersOnThisFloor(Room, Set)
public boolean doesHavePriviledgesInThisDirection(MOB mob, Room room, Exit exit)
LegalLibrary
doesHavePriviledgesInThisDirection
in interface LegalLibrary
mob
- the mobroom
- the mobs current roomexit
- the exit in the room denoting the directionLegalLibrary.doesHavePrivilegesWith(MOB, PrivateProperty)
,
LegalLibrary.doesAnyoneHavePrivilegesHere(MOB, String, Room)
,
LegalLibrary.doesHavePriviledgesHere(MOB, Room)
public boolean doesHavePrivilegesWith(MOB mob, PrivateProperty record)
LegalLibrary
doesHavePrivilegesWith
in interface LegalLibrary
mob
- the mob to checkrecord
- the property to checkLegalLibrary.doesHaveWeakPrivilegesWith(MOB, PrivateProperty)
,
LegalLibrary.doesHavePriviledgesInThisDirection(MOB, Room, Exit)
,
LegalLibrary.doesHavePriviledgesHere(MOB, Room)
,
LegalLibrary.doesAnyoneHavePrivilegesHere(MOB, String, Room)
public boolean doesHaveWeakPrivilegesWith(MOB mob, PrivateProperty record)
LegalLibrary
doesHaveWeakPrivilegesWith
in interface LegalLibrary
mob
- the mob to checkrecord
- the record to checkLegalLibrary.doesHaveWeakPriviledgesHere(MOB, Room)
public boolean doesHavePriviledgesHere(MOB mob, Room room)
LegalLibrary
doesHavePriviledgesHere
in interface LegalLibrary
mob
- the mobroom
- the roomLegalLibrary.doesHavePrivilegesWith(MOB, PrivateProperty)
,
LegalLibrary.doesAnyoneHavePrivilegesHere(MOB, String, Room)
,
LegalLibrary.doesHavePriviledgesInThisDirection(MOB, Room, Exit)
public boolean doesHaveWeakPriviledgesHere(MOB mob, Room room)
LegalLibrary
doesHaveWeakPriviledgesHere
in interface LegalLibrary
mob
- the mob to checkroom
- the room to checkLegalLibrary.doesHaveWeakPrivilegesWith(MOB, PrivateProperty)
protected boolean doesHaveClanFriendlyPrivilegesHere(MOB mob, java.lang.String clanID)
public boolean doesAnyoneHavePrivilegesHere(MOB mob, java.lang.String overrideID, Room R)
LegalLibrary
doesAnyoneHavePrivilegesHere
in interface LegalLibrary
mob
- the mob to check firstoverrideID
- "", or another property ownerR
- the room with possible privilegedLegalLibrary.doesHavePrivilegesWith(MOB, PrivateProperty)
,
LegalLibrary.doesHavePriviledgesHere(MOB, Room)
,
LegalLibrary.doesHavePriviledgesInThisDirection(MOB, Room, Exit)
public java.lang.String getPropertyOwnerName(Room room)
LegalLibrary
getPropertyOwnerName
in interface LegalLibrary
room
- the room to checkLegalLibrary.isLandOwnable(Room)
,
LegalLibrary.getLandOwnerName(Room)
public java.lang.String getLandOwnerName(Room room)
LegalLibrary
getLandOwnerName
in interface LegalLibrary
room
- the room to checkLegalLibrary.getPropertyOwnerName(Room)
,
LegalLibrary.isLandOwnable(Room)
public boolean isLandOwnable(Room room)
LegalLibrary
isLandOwnable
in interface LegalLibrary
room
- the room to checkLegalLibrary.getPropertyOwnerName(Room)
,
LegalLibrary.getLandOwnerName(Room)
public boolean isLandOwnersName(java.lang.String name, Room room)
LegalLibrary
isLandOwnersName
in interface LegalLibrary
name
- the name (mob or clan) to check for ownership statusroom
- the property to checkLegalLibrary.doesOwnThisLand(MOB, Room)
public boolean isPropertyOwnersName(java.lang.String name, Room room)
LegalLibrary
isPropertyOwnersName
in interface LegalLibrary
name
- the name (mob or clan) to check for ownership statusroom
- the property to checkLegalLibrary.doesOwnThisProperty(MOB, PrivateProperty)
,
LegalLibrary.doesOwnThisProperty(MOB, Room)
public boolean doesOwnThisProperty(MOB mob, Room room)
LegalLibrary
doesOwnThisProperty
in interface LegalLibrary
mob
- the mob to check for ownership statusroom
- the property to checkLegalLibrary.doesOwnThisProperty(MOB, PrivateProperty)
,
LegalLibrary.isPropertyOwnersName(String, Room)
public boolean doesOwnThisProperty(MOB mob, PrivateProperty record)
LegalLibrary
doesOwnThisProperty
in interface LegalLibrary
mob
- the mob to check for ownership statusrecord
- the property record to checkLegalLibrary.doesOwnThisProperty(MOB, Room)
,
LegalLibrary.isPropertyOwnersName(String, Room)
public MOB getPropertyOwner(PrivateProperty record)
LegalLibrary
getPropertyOwner
in interface LegalLibrary
record
- the property recordpublic boolean canAttackThisProperty(MOB mob, PrivateProperty record)
LegalLibrary
canAttackThisProperty
in interface LegalLibrary
mob
- the attackerrecord
- the property record for the given propertypublic Deity.DeityWorshipper getClericInfusion(Physical P)
LegalLibrary
getClericInfusion
in interface LegalLibrary
P
- the thing to check for infusionDeity.DeityWorshipper
public java.lang.String getClericInfused(Physical P)
LegalLibrary
getClericInfused
in interface LegalLibrary
P
- the thing to check for infusionpublic boolean doesOwnThisLand(MOB mob, Room room)
LegalLibrary
doesOwnThisLand
in interface LegalLibrary
mob
- the mob to check for ownership statusroom
- the property to checkLegalLibrary.isLandOwnersName(String, Room)
public boolean isLegalOfficerHere(MOB mob)
LegalLibrary
isLegalOfficerHere
in interface LegalLibrary
mob
- the mob to checkLegalLibrary.isLegalJudgeHere(MOB)
,
LegalLibrary.isLegalOfficialHere(MOB)
public boolean isLegalJudgeHere(MOB mob)
LegalLibrary
isLegalJudgeHere
in interface LegalLibrary
mob
- the mob to checkLegalLibrary.isLegalOfficerHere(MOB)
,
LegalLibrary.isLegalOfficialHere(MOB)
public boolean isLegalOfficialHere(MOB mob)
LegalLibrary
isLegalOfficialHere
in interface LegalLibrary
mob
- the mob to checkLegalLibrary.isLegalJudgeHere(MOB)
,
LegalLibrary.isLegalOfficerHere(MOB)
public void colorRoomForSale(Room R, LandTitle title, boolean reset)
LegalLibrary
colorRoomForSale
in interface LegalLibrary
R
- the room that's for saletitle
- the rooms land titlereset
- reset the room descriptionprotected boolean shopkeeperMobPresent(Room R)
public boolean robberyCheck(PrivateProperty record, CMMsg msg, boolean quiet)
LegalLibrary
robberyCheck
in interface LegalLibrary
record
- the property record for the roommsg
- the event to checkquiet
- true to not report anything to the source of the eventLegalLibrary.doesHavePriviledgesHere(MOB, Room)
public PrivateProperty getPropertyRecord(Item item)
LegalLibrary
getPropertyRecord
in interface LegalLibrary
item
- the item to checkLegalLibrary.getPropertyRecord(Area)
,
LegalLibrary.getPropertyRecord(Room)
,
LegalLibrary.getPropertyRecord(MOB)
,
LegalLibrary.getLandTitle(Area)
,
LegalLibrary.getLandTitle(Room)
public boolean mayOwnThisItem(MOB mob, Item item)
LegalLibrary
mayOwnThisItem
in interface LegalLibrary
mob
- the mob to check possible item ownership ofitem
- the item to checkLegalLibrary.doesHavePrivilegesWith(MOB, PrivateProperty)
,
LegalLibrary.doesHaveWeakPrivilegesWith(MOB, PrivateProperty)