com.threerings.tudey.server.logic
Class HandlerLogic.BaseIntersectionCount
java.lang.Object
com.threerings.util.ShallowObject
com.threerings.tudey.server.logic.Logic
com.threerings.tudey.server.logic.HandlerLogic
com.threerings.tudey.server.logic.HandlerLogic.ActionHandlerLogic
com.threerings.tudey.server.logic.HandlerLogic.Transition
com.threerings.tudey.server.logic.HandlerLogic.BaseIntersection
com.threerings.tudey.server.logic.HandlerLogic.BaseIntersectionCount
- All Implemented Interfaces:
- Logic.ShapeObserver, TudeySceneManager.IntersectionSensor, TudeySceneManager.Sensor, TudeySceneManager.TickParticipant
- Direct Known Subclasses:
- HandlerLogic.ThresholdIntersectionCount
- Enclosing class:
- HandlerLogic
public abstract static class HandlerLogic.BaseIntersectionCount
- extends HandlerLogic.BaseIntersection
- implements TudeySceneManager.IntersectionSensor
Handles the intersection count event.
| Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.HandlerLogic |
HandlerLogic.ActionHandlerLogic, HandlerLogic.ActorAdded, HandlerLogic.ActorRemoved, HandlerLogic.BaseActorObserver, HandlerLogic.BaseBodyObserver, HandlerLogic.BaseIntersection, HandlerLogic.BaseIntersectionCount, HandlerLogic.BodyEntered, HandlerLogic.BodyLeft, HandlerLogic.Intersection, HandlerLogic.IntersectionStart, HandlerLogic.IntersectionStop, HandlerLogic.Reference, HandlerLogic.Request, HandlerLogic.Shutdown, HandlerLogic.Signal, HandlerLogic.SignalStart, HandlerLogic.SignalStop, HandlerLogic.Startup, HandlerLogic.ThresholdIntersectionCount, HandlerLogic.Tick, HandlerLogic.Timer, HandlerLogic.Transition, HandlerLogic.VariableChanged, HandlerLogic.WarnTimer |
|
Method Summary |
protected abstract void |
countChanged(int timestamp,
int newCount)
Called when the intersection count changes. |
protected void |
didInit()
Override to perform custom initialization. |
int |
getMask()
Returns the sensor's bitmask. |
boolean |
tick(int timestamp)
Ticks the participant. |
void |
transfer(Logic source,
Map<Object,Object> refs)
Transfers state from the specified source logic. |
void |
trigger(int timestamp,
ActorLogic actor)
Triggers the sensor. |
| Methods inherited from class com.threerings.tudey.server.logic.Logic |
addShapeObserver, createAction, createCondition, createExpression, createHandler, createRegion, createTarget, getModel, getPatrolPath, getSceneManager, getShape, getTags, getTransform, getTransform, getVariable, init, isDefaultEntrance, isVisible, removeShapeObserver, request, resolveTarget, setVariable, signal |
_condition
protected ConditionLogic _condition
- The condition to evaluate.
_lastCount
protected int _lastCount
- The last known count.
HandlerLogic.BaseIntersectionCount
public HandlerLogic.BaseIntersectionCount()
- Creates a new base intersection count handler.
getMask
public int getMask()
- Description copied from interface:
TudeySceneManager.Sensor
- Returns the sensor's bitmask. Only triggers whose flags intersect the mask will
activate the sensor.
- Specified by:
getMask in interface TudeySceneManager.Sensor
trigger
public void trigger(int timestamp,
ActorLogic actor)
- Description copied from interface:
TudeySceneManager.Sensor
- Triggers the sensor.
- Specified by:
trigger in interface TudeySceneManager.Sensor
- Parameters:
timestamp - the timestamp of the intersection.actor - the logic object of the actor that triggered the sensor.
tick
public boolean tick(int timestamp)
- Description copied from interface:
TudeySceneManager.TickParticipant
- Ticks the participant.
- Specified by:
tick in interface TudeySceneManager.TickParticipant- Overrides:
tick in class HandlerLogic.Transition
- Parameters:
timestamp - the timestamp of the current tick.
- Returns:
- true to continue ticking the participant, false to remove it from the list.
transfer
public void transfer(Logic source,
Map<Object,Object> refs)
- Description copied from class:
Logic
- Transfers state from the specified source logic. Where relevant, this also takes the place
of addition/startup notification.
- Overrides:
transfer in class HandlerLogic.BaseIntersection
didInit
protected void didInit()
- Description copied from class:
HandlerLogic
- Override to perform custom initialization.
- Overrides:
didInit in class HandlerLogic.ActionHandlerLogic
countChanged
protected abstract void countChanged(int timestamp,
int newCount)
- Called when the intersection count changes.