Comment 5 for bug 576347

Revision history for this message
SirVer (sirver) wrote : Re: win condition sends a message only

You can add the functions wherever you want. On class Game, on class Gamecontroller. The most important thing is, what we want to transmit. I suggest making those functions flexible by taking a boolean value (win,loose) and an optional string from lua. Individual win conditions can then encode data in this string. For example for collectors, the win call could look like:

wl.game.player_won(plr, "points=1234")

or maybe more complex:
wl.game.player_won(plr, "trunk=12;raw_stone=3")

For now, i would expose them in the wl.game module. Or rather in the wl.game.Player class? And I'd prefer to collapse this into just one function, but I can't think of a good name.

Just let me know when the c backend is in place. I'll add the Lua functions then right away.