com.threerings.tudey.server.logic
Class TargetLogic

java.lang.Object
  extended by com.threerings.util.ShallowObject
      extended by com.threerings.tudey.server.logic.Logic
          extended by com.threerings.tudey.server.logic.TargetLogic
Direct Known Subclasses:
TargetLogic.Activator, TargetLogic.Behavior, TargetLogic.Compound, TargetLogic.Conditional, TargetLogic.Excluding, TargetLogic.InstanceOf, TargetLogic.Intersecting, TargetLogic.Randomized, TargetLogic.Source, TargetLogic.Subset, TargetLogic.Tagged

public abstract class TargetLogic
extends Logic

Handles the resolution of targets.


Nested Class Summary
static class TargetLogic.Activator
          Refers to the actor that triggered the action.
static class TargetLogic.Behavior
          Handles the behavior target.
static class TargetLogic.Compound
          Refers to multiple targets.
static class TargetLogic.Conditional
          Limits targets to those satisfying a condition.
static class TargetLogic.DistanceSubset
          Superclass of the distance-based subsets.
static class TargetLogic.Excluding
          Handles the excluding target.
static class TargetLogic.FarthestSubset
          Limits targets to the farthest subset.
static class TargetLogic.InstanceOf
          Refers to entities of a certain logic class.
static class TargetLogic.Intersecting
          Refers to the entities intersecting a reference entity.
static class TargetLogic.NearestSubset
          Limits targets to the nearest subset.
static class TargetLogic.Randomized
          Logic class for randomized target.
static class TargetLogic.RandomSubset
          Limits targets to a random subset.
static class TargetLogic.Source
          Refers to the action source.
static class TargetLogic.Subset
          Base class for targets limited to a sized subset.
static class TargetLogic.Tagged
          Refers to an entity or entities bearing a certain tag.
 
Nested classes/interfaces inherited from class com.threerings.tudey.server.logic.Logic
Logic.ShapeObserver
 
Constructor Summary
TargetLogic()
           
 
Method Summary
 EntityKey getEntityKey()
          Returns the entity key for this logic, if any.
 float getRotation()
          Returns the rotation of this logic for the purpose of spawning actors, etc.
 Vector2f getTranslation()
          Returns the translation of this logic for the purpose of spawning actors, etc.
 void init(TudeySceneManager scenemgr, TargetConfig config, Logic source)
          Initializes the logic.
 boolean isActive()
          Determines whether this logic object is still active in the scene.
abstract  void resolve(Logic activator, Collection<Logic> results)
          Resolves the list of targets, placing the results in the supplied collection.
 
Methods inherited from class com.threerings.tudey.server.logic.Logic
addShapeObserver, getModel, getPatrolPath, getSceneManager, getShape, getTags, getTransform, getTransform, getVariable, init, isDefaultEntrance, isVisible, removeShapeObserver, request, resolveTarget, setVariable, signal, transfer
 
Methods inherited from class com.threerings.util.ShallowObject
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TargetLogic

public TargetLogic()
Method Detail

init

public void init(TudeySceneManager scenemgr,
                 TargetConfig config,
                 Logic source)
Initializes the logic.


resolve

public abstract void resolve(Logic activator,
                             Collection<Logic> results)
Resolves the list of targets, placing the results in the supplied collection.

Parameters:
activator - the entity that triggered the action.

isActive

public boolean isActive()
Description copied from class: Logic
Determines whether this logic object is still active in the scene.

Overrides:
isActive in class Logic

getEntityKey

public EntityKey getEntityKey()
Description copied from class: Logic
Returns the entity key for this logic, if any.

Overrides:
getEntityKey in class Logic

getTranslation

public Vector2f getTranslation()
Description copied from class: Logic
Returns the translation of this logic for the purpose of spawning actors, etc.

Overrides:
getTranslation in class Logic

getRotation

public float getRotation()
Description copied from class: Logic
Returns the rotation of this logic for the purpose of spawning actors, etc.

Overrides:
getRotation in class Logic


Copyright © 2011. All Rights Reserved.