com.planet_ink.coffee_mud.core.interfaces
Interface Followable<T extends Followable<T>>

Type Parameters:
T - an extension of Followable, showing that Followables follow/are followed by Followables
All Superinterfaces:
Affectable, java.lang.Cloneable, CMObject, java.lang.Comparable<CMObject>, Contingent, Environmental, Modifiable, MsgListener, Physical, StatsAffecting, Tickable
All Known Subinterfaces:
Deity, MOB
All Known Implementing Classes:
Alligator, AngryCitizen, Ape, Assassin, Beaver, Bee, BlackBear, BlackDragon, BlueDragon, BrassDragon, BronzeDragon, BrownBear, BrownSnake, Buck, Buffalo, Bugbear, Bull, Cat, Centaur, Centipede, Cheetah, Chicken, Chimp, Citizen, Cobra, CommonBat, CopperDragon, Cougar, Cow, Coyote, Crocodile, Deer, DireWolf, Doe, Dog, Dolphin, Doppleganger, Dragon, DrowElf, DrowPriestess, DrowWarrior, DrowWizard, Duck, Elephant, Falcon, FireGiant, FlyingInsect, Fox, Frog, FrostGiant, GardenSnake, GenAuctioneer, GenBanker, GenCow, GenDeity, GenHorse, GenLibrarian, GenMob, GenPostman, GenRideable, GenShopkeeper, GenUndead, GiantBat, GiantScorpion, Gnoll, Goat, GoatDoe, Goblin, GoldDragon, Gorilla, GreenDragon, Hawk, HeavenlyServent, HillGiant, Hornet, Horse, InvisibleStalker, Jaguar, Kitten, LargeBat, Lion, Lizard, LizardMan, LizardManShaman, Minotaur, Monkey, MountainLion, Mouse, Naga, Ogre, Orc, Owl, Panther, Parakeet, Pegasus, PegasusGreater, Penguin, Pig, Puppy, Python, Rabbit, Rat, Rattlesnake, Raven, RedDragon, Scorpion, Seal, Shark, Sheep, SilverDragon, Skeleton, Snake, Spider, Squirrel, StdAuctioneer, StdBanker, StdDeity, StdFactoryMOB, StdLibrarian, StdMOB, StdPostman, StdRideable, StdShopKeeper, StoneGiant, StoneGolem, Swordfish, Teacher, Tiger, Toad, Troll, Turtle, UmberHulk, Undead, Vulture, Walrus, Whale, WhiteBear, WhiteDragon, WildEagle, Wolf, Wolverine, Worm, Wyvern, Zombie

public interface Followable<T extends Followable<T>>
extends Physical

The Followable interface defines methods to both the follower, and the thing being followed, since it is assumed that following is a transitive property.


Field Summary
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
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_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, 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_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
Method Summary
 void addFollower(T follower, int order)
          Adds/Alters a follower to this Followable, of the appropriate type, while also setting the order/rank they hold in the line.
 T amFollowing()
          Returns the followable that this followable follower is following, or null.
 T amUltimatelyFollowing()
          If this followable follower is following a followable that is also following a followable, then this will recursively determine the First followable and return it.
 void delFollower(T follower)
          Removes the given follower from this followable.
 T fetchFollower(int index)
          Returns the followable follower at the give index in this collection
 T fetchFollower(java.lang.String named)
          Returns the followable follower that best matches the given search string name.
 int fetchFollowerOrder(T thisOne)
          Returns the relative order/rank of the specific follower in the formation.
 java.util.Enumeration<Pair<T,java.lang.Short>> followers()
          Returns an enumeration of the followers of this Followable, along with their relative rank/position in the formation.
 java.util.Set<T> getGroupMembers(java.util.Set<T> list)
          Fills the given set with the Complete set of all followable followers by counting not only this followable, but all the recursive followable followers of this followable, and all the followables followed by this followable and all their followable followers.
 java.util.Set<? extends Rider> getGroupMembersAndRideables(java.util.Set<? extends Rider> list)
          Fills the given set with the Complete set of all followable followers by counting not only this followable, but all the recursive followable followers of this followable, and all the followables followed by this followable and all their followable followers.
 boolean isFollowedBy(T thisOne)
          Returns whether the given followable is following this followable.
 int numFollowers()
          Returns the total number of Direct followers
 void setFollowing(T mob)
          Alters who this followable follower is following.
 int totalFollowers()
          Returns the total number of followable followers following this followable by counting not only the followable followers of this followable, but also the followable followers of the followable followers of this followable, recursively.
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Physical
description, displayText, name
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Environmental
description, displayText, expirationDate, image, isGeneric, L, maxRange, minRange, miscTextFormat, Name, rawImage, sameAs, setDescription, setDisplayText, setExpirationDate, setImage, setMiscText, setName, text
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
getTickStatus, name, tick
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.StatsAffecting
affectCharState, affectCharStats, affectPhyStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.MsgListener
executeMsg, okMessage
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Contingent
amDestroyed, destroy, isSavable, setSavable
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Modifiable
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Affectable
addEffect, addNonUninvokableEffect, basePhyStats, delAllEffects, delEffect, eachEffect, effects, fetchEffect, fetchEffect, numEffects, phyStats, recoverPhyStats, setBasePhyStats
 

Method Detail

addFollower

void addFollower(T follower,
                 int order)
Adds/Alters a follower to this Followable, of the appropriate type, while also setting the order/rank they hold in the line. Orders don't have to be unique. This does NOT call setFollowing on the follower, so that would also need to be done, and, in fact, can be done instead if you like.

Parameters:
follower - the new follower to follow
order - the relative position of the new follower in the formation
See Also:
setFollowing(Followable)

delFollower

void delFollower(T follower)
Removes the given follower from this followable.

Parameters:
follower - the follower to remove

numFollowers

int numFollowers()
Returns the total number of Direct followers

Returns:
the total number of Direct followers
See Also:
totalFollowers()

fetchFollowerOrder

int fetchFollowerOrder(T thisOne)
Returns the relative order/rank of the specific follower in the formation.

Parameters:
thisOne - the specific followable
Returns:
the relative order/rank of the specific follower

isFollowedBy

boolean isFollowedBy(T thisOne)
Returns whether the given followable is following this followable.

Parameters:
thisOne - the followable follower to look for.
Returns:
true if thisOne is following, false otherwise

followers

java.util.Enumeration<Pair<T,java.lang.Short>> followers()
Returns an enumeration of the followers of this Followable, along with their relative rank/position in the formation.

Returns:
an enumeration of the followers of this Followable

fetchFollower

T fetchFollower(int index)
Returns the followable follower at the give index in this collection

Parameters:
index - the index (0-based) of the followable follower
Returns:
the followable follower at the give index in this collection

fetchFollower

T fetchFollower(java.lang.String named)
Returns the followable follower that best matches the given search string name.

Parameters:
named - the search string name
Returns:
the followable follower that best matches

totalFollowers

int totalFollowers()
Returns the total number of followable followers following this followable by counting not only the followable followers of this followable, but also the followable followers of the followable followers of this followable, recursively.

Returns:
the total number of followers
See Also:
numFollowers()

amFollowing

T amFollowing()
Returns the followable that this followable follower is following, or null.

Returns:
the followable that this followable follower is following, or null.

amUltimatelyFollowing

T amUltimatelyFollowing()
If this followable follower is following a followable that is also following a followable, then this will recursively determine the First followable and return it.

Returns:
the first followable

setFollowing

void setFollowing(T mob)
Alters who this followable follower is following. This also calls addFollower above.

Parameters:
mob - the follower following
See Also:
addFollower(Followable, int)

getGroupMembers

java.util.Set<T> getGroupMembers(java.util.Set<T> list)
Fills the given set with the Complete set of all followable followers by counting not only this followable, but all the recursive followable followers of this followable, and all the followables followed by this followable and all their followable followers.

Parameters:
list - requires list to populate with followables
Returns:
the same list, filled

getGroupMembersAndRideables

java.util.Set<? extends Rider> getGroupMembersAndRideables(java.util.Set<? extends Rider> list)
Fills the given set with the Complete set of all followable followers by counting not only this followable, but all the recursive followable followers of this followable, and all the followables followed by this followable and all their followable followers. It also includes all their rideables, and their rideables riders, and those riders rideables.

Parameters:
list - requires list to populate with followables and rideables
Returns:
the same list, filled