So far it's working quite well, and it is rather pleasant to code. There are no safeguards whatsoever for now. They will come along with their tests :3master
parent
205608d75f
commit
e5cb86068d
@ -1,13 +1,42 @@
|
||||
extends Reference
|
||||
class_name MajorityJudgmentAbstractJudgmentsProvider
|
||||
#class_name MajorityJudgmentAbstractProvider # perhaps this? (short = sweet)
|
||||
|
||||
|
||||
# Abstract class for Judgment Providers
|
||||
# Abstract class for (Judgment) Providers
|
||||
# The job of the children is to emit the judgment_emitted signal.
|
||||
#
|
||||
# Example providers (ideas):
|
||||
# - Test/Demo providers
|
||||
# - Twitch chat commands (like "A3B2C0")
|
||||
# - Youtube Live chat commands (if possible)
|
||||
# - IRC chat commands (low, as a bot would be better)
|
||||
# - Discord, somehow
|
||||
# - Riot, Jami, etc.
|
||||
# - Heck, any videoconferencing software with a workable API
|
||||
#
|
||||
# So far, providers don't care about whether the candidate or grade indices
|
||||
# are within correct range ; that work will be done by the listener to the
|
||||
# "judgment_emitted" event, and it will do its best, and ignore bad data.
|
||||
#
|
||||
# See MajorityJudgmentLinearResultsControl.gd, that's where a (the) listener is.
|
||||
|
||||
|
||||
signal judgment_emitted(
|
||||
author_identifier, # String, unique per author (aka participant)
|
||||
candidate_index, # int
|
||||
grade_index # int (0 == REJECT, up to the grading size minus one)
|
||||
grade_index, # int (0 == REJECT, up to the grading size minus one)
|
||||
candidate_index # int, position in the original array of candidates
|
||||
)
|
||||
|
||||
|
||||
# Called by the scene managing the poll's lifecycle.
|
||||
# See MajorityJudgmentLinearResultsControl.gd
|
||||
# Meant to be overridden (put your logic here instead of _init)
|
||||
func start_providing():
|
||||
pass
|
||||
|
||||
|
||||
# Meant to be overridden.
|
||||
# In here you can stop your timers, close your network connections, etc.
|
||||
func stop_providing():
|
||||
pass
|
||||
|
@ -0,0 +1,20 @@
|
||||
extends MajorityJudgmentChatCommandJudgmentsProvider
|
||||
class_name MajorityJudgmentDemoProvider
|
||||
|
||||
|
||||
func start_providing():
|
||||
yield(App.timer(1), "timeout")
|
||||
process_chat_command("Stup", "A0B1C3")
|
||||
yield(App.timer(1), "timeout")
|
||||
process_chat_command("Flip", "A0B2C1")
|
||||
yield(App.timer(1), "timeout")
|
||||
process_chat_command("Flip", "A1")
|
||||
yield(App.timer(1), "timeout")
|
||||
process_chat_command("Clap", "A3B4")
|
||||
yield(App.timer(1), "timeout")
|
||||
process_chat_command("Clap", "C5B3")
|
||||
yield(App.timer(2), "timeout")
|
||||
process_chat_command("Neo", "B5")
|
||||
yield(App.timer(1), "timeout")
|
||||
process_chat_command("April", "A4")
|
||||
|
Loading…
Reference in new issue