Polls
public interface PollManager extends CMLibrary
idConverter
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>[] |
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.
|
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.
|
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, propertiesLoaded, shutdown
copyOf, ID, initializeClass, name, newInstance
java.util.List<Poll>[] getMyPollTypes(MOB mob, boolean login)
mob
- the player for whom polls are requiredlogin
- true if requested during login, false otherwisegetPoll(String)
,
getPoll(int)
,
getPollList()
Poll getPoll(java.lang.String named)
named
- the name of the pollgetPoll(String)
,
getPoll(int)
,
getPollList()
,
getMyPollTypes(MOB, boolean)
Poll getPoll(int x)
x
- the 0 based ordinalgetPoll(String)
,
getPoll(int)
,
getPollList()
,
getMyPollTypes(MOB, boolean)
java.util.Iterator<Poll> getPollList()
getPoll(String)
,
getPoll(int)
,
getPollList()
,
getMyPollTypes(MOB, boolean)
void processVote(Poll P, MOB mob)
P
- the Poll objectmob
- the player who can vote on itmodifyVote(Poll, MOB)
,
processResults(Poll, MOB)
void modifyVote(Poll P, MOB mob) throws java.io.IOException
P
- the Poll objectmob
- the player who can edit itjava.io.IOException
- the ioexception from the mob interactionprocessVote(Poll, MOB)
,
processResults(Poll, MOB)
void processResults(Poll P, MOB mob)
P
- the Poll object, with maybe just a namemob
- the player to show results toprocessVote(Poll, MOB)
,
modifyVote(Poll, MOB)
void updatePollResults(Poll P)
P
- the poll with resultsupdatePoll(String, Poll)
void updatePoll(java.lang.String oldName, Poll P)
oldName
- the name of an existing pollP
- the poll to update in the databaseupdatePollResults(Poll)
void addPoll(Poll P)
P
- the Poll object to cachecreatePoll(Poll)
void createPoll(Poll P)
P
- the fully populated Poll objectaddPoll(Poll)
,
loadPollByName(String)
,
loadPollIfNecessary(Poll)
void removePoll(Poll P)
P
- the Poll object to de-cachedeletePoll(Poll)
void deletePoll(Poll P)
P
- a Poll object with a nameremovePoll(Poll)
Poll loadPollByName(java.lang.String name)
name
- the name of the pollloadPollIfNecessary(Poll)
,
addPoll(Poll)
boolean loadPollIfNecessary(Poll P)
P
- the Poll object, which might need filling outloadPollByName(String)
,
addPoll(Poll)