Open Mercerenies opened 11 months ago
The four classes, as they appear now (b68435d):
interface TriviaQuestionReward {
val name: Component
fun rewardPlayer(player: Player): Unit
}
interface CookieEffect {
fun cancelsDefault(): Boolean
fun onEat(action: CookieEatenAction)
}
interface BowserReward {
fun getMainRewardText(): Component
fun getSpecialRewardText(player: Player): Component
fun giveMainReward(player: Player): Unit
fun giveSpecialReward(player: Player): Unit
}
interface CakeEffect {
fun cancelsDefault(): Boolean
fun onEat(loc: Location, player: Player)
}
Doctor Dances also has a reward interface, and so does Prisoner's Dilemma
We have a lot of different reward or effect classes right now, whose methods all boil down to some variant of
Among these, we have
TriviaQuestionReward
, which takes only aPlayer
but also has aname: Component
field.CookieEffect
, which hascancelsDefault()
and its context isCookieEatenAction
(stack, player, and death registry).CakeEffect
, which hascancelsDefault()
andpositivity
, and its context is the location of the cake in the world.These three should, at minimum, inherit from a common super-interface.
As a stretch goal, we also have
BowserReward
, which is different in that it rewards all players (with one player getting a special reward). It's not as similar to the others, but it's worth mentioning.