CMObject, Tickable, CMLibrary, PollManager, java.lang.Cloneable, java.lang.Comparable<CMObject>public class Polls extends StdLibrary implements PollManager
| Modifier and Type | Field | Description |
|---|---|---|
SVector<Poll> |
pollCache |
idConverterisDebugging, name, serviceClient, tickStatusSTATUS_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 |
|---|---|
Polls() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addPoll(Poll P) |
Given a Poll object, this will add it to the memory
cache -- that is all.
|
void |
createPoll(Poll P) |
Given a fully populated Poll object,
this will create the Poll in the database,
and add it to the cache.
|
void |
deletePoll(Poll P) |
Given a Poll object with a name filled in,
this will delete the Poll from the database
and remove it from the cache.
|
java.util.List<Poll> |
getCache() |
|
java.util.List<Poll>[] |
getMyPollTypes(MOB mob,
boolean login) |
Returns polls divided into three groups as
three list objects:
0 - Polls the given mob can vote in
1 - If during logic, polls the mob can't vote it during login
2 - Polls the given mob can see results of
|
Poll |
getPoll(int x) |
Given a 0-bound number, this will return a poll with
the same ordinal as it appeared in getPollList
|
Poll |
getPoll(java.lang.String named) |
Given a poll name, this will return the poll with
that name, loading it fully from the database if
necessary.
|
java.util.Iterator<Poll> |
getPollList() |
Returns a complete list of all database polls.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
Poll |
loadPollByName(java.lang.String name) |
Given the name of a poll, this will attempt to load it
from the database and return the fully populated
Poll object.
|
boolean |
loadPollIfNecessary(Poll P) |
Given a Poll object which might contain nothing more than a name,
this will load the entirety of the Poll object, if necessary.
|
void |
modifyVote(Poll P,
MOB mob) |
Given a Poll object fully loaded, and a
archon-ish mob, this will allow the settings of the
poll to be edited.
|
void |
processResults(Poll P,
MOB mob) |
Given a Poll object with as little as a name, and a
player mob, this will show the results of the poll
to the given user, possibly loading the Poll in the
process.
|
void |
processVote(Poll P,
MOB mob) |
Given a Poll object with as little as a name, and a
player mob, this will allow the mob to vote in the poll,
possibly loading the poll fully in the process.
|
void |
removePoll(Poll P) |
Given a Poll object that might be cached,
this will remove the object from the cache.
|
boolean |
shutdown() |
Shuts down the library.
|
void |
updatePoll(java.lang.String oldName,
Poll P) |
Given the name of an existing Poll in the database,
and a Poll object, this will update the database entry
accordingly
|
void |
updatePollResults(Poll P) |
Given an existing Poll in the database that has
new Poll Results added to it, this will update
those results in the database.
|
activate, getServiceClient, L, propertiesLoadedcopyOf, initializeClass, name, newInstanceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitactivate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, tickpublic java.lang.String ID()
CMObjectID in interface CMObjectID in class StdLibrarypublic boolean shutdown()
CMLibraryshutdown in interface CMLibraryshutdown in class StdLibraryCMLibrary.activate()public void addPoll(Poll P)
PollManageraddPoll in interface PollManagerP - the Poll object to cachePollManager.createPoll(Poll)public void removePoll(Poll P)
PollManagerremovePoll in interface PollManagerP - the Poll object to de-cachePollManager.deletePoll(Poll)public java.util.List<Poll> getCache()
public Poll getPoll(java.lang.String named)
PollManagergetPoll in interface PollManagernamed - the name of the pollPollManager.getPoll(String),
PollManager.getPoll(int),
PollManager.getPollList(),
PollManager.getMyPollTypes(MOB, boolean)public Poll getPoll(int x)
PollManagergetPoll in interface PollManagerx - the 0 based ordinalPollManager.getPoll(String),
PollManager.getPoll(int),
PollManager.getPollList(),
PollManager.getMyPollTypes(MOB, boolean)public java.util.List<Poll>[] getMyPollTypes(MOB mob, boolean login)
PollManagergetMyPollTypes in interface PollManagermob - the player for whom polls are requiredlogin - true if requested during login, false otherwisePollManager.getPoll(String),
PollManager.getPoll(int),
PollManager.getPollList()public java.util.Iterator<Poll> getPollList()
PollManagergetPollList in interface PollManagerPollManager.getPoll(String),
PollManager.getPoll(int),
PollManager.getPollList(),
PollManager.getMyPollTypes(MOB, boolean)public void processVote(Poll P, MOB mob)
PollManagerprocessVote in interface PollManagerP - the Poll objectmob - the player who can vote on itPollManager.modifyVote(Poll, MOB),
PollManager.processResults(Poll, MOB)public void modifyVote(Poll P, MOB mob) throws java.io.IOException
PollManagermodifyVote in interface PollManagerP - the Poll objectmob - the player who can edit itjava.io.IOException - the ioexception from the mob interactionPollManager.processVote(Poll, MOB),
PollManager.processResults(Poll, MOB)public void processResults(Poll P, MOB mob)
PollManagerprocessResults in interface PollManagerP - the Poll object, with maybe just a namemob - the player to show results toPollManager.processVote(Poll, MOB),
PollManager.modifyVote(Poll, MOB)public void createPoll(Poll P)
PollManagercreatePoll in interface PollManagerP - the fully populated Poll objectPollManager.addPoll(Poll),
PollManager.loadPollByName(String),
PollManager.loadPollIfNecessary(Poll)public void updatePollResults(Poll P)
PollManagerupdatePollResults in interface PollManagerP - the poll with resultsPollManager.updatePoll(String, Poll)public void updatePoll(java.lang.String oldName,
Poll P)
PollManagerupdatePoll in interface PollManageroldName - the name of an existing pollP - the poll to update in the databasePollManager.updatePollResults(Poll)public void deletePoll(Poll P)
PollManagerdeletePoll in interface PollManagerP - a Poll object with a namePollManager.removePoll(Poll)public boolean loadPollIfNecessary(Poll P)
PollManagerloadPollIfNecessary in interface PollManagerP - the Poll object, which might need filling outPollManager.loadPollByName(String),
PollManager.addPoll(Poll)public Poll loadPollByName(java.lang.String name)
PollManagerloadPollByName in interface PollManagername - the name of the pollPollManager.loadPollIfNecessary(Poll),
PollManager.addPoll(Poll)