scoring.hrl 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. -ifndef(SCORING_HRL).
  2. -define(SCORING_HRL, "scoring_hrl").
  3. -include_lib("kvs/include/kvs.hrl").
  4. -record(ti_game_event, {
  5. id :: integer(), %% GameId
  6. type,
  7. game_name,
  8. game_mode,
  9. double_points,
  10. tournament_type = standalone }).
  11. -record(player_scoring, {
  12. ?ITERATOR(feed),
  13. temp,
  14. permanent, %% top of Permanent Scoring record linked list
  15. %%-- aggregated score for all game types is is a list
  16. %% [{game_okey, 15},{game_tavla, 12},...]
  17. agregated_score
  18. }).
  19. -record(scoring_record, {
  20. ?ITERATOR(feed),
  21. game_id, %% game id for rematching and lost connections
  22. who, %% player
  23. all_players, %% with other players
  24. game_type, %% okey, tavla, batak
  25. game_kind, %% chanak, standard, even-odd
  26. condition, %% reveal with even tashes, color okey reveal, show gosterge, batak 3 aces, tavla mars.
  27. score_points, %% result score points for player
  28. score_kakaush, %% result score kakuş for player
  29. custom, %% erlang record for a specific game
  30. timestamp %% now() of the record
  31. }).
  32. %% total count of everything
  33. -record(personal_score, {
  34. ?ITERATOR(feed),
  35. uid,
  36. games = 0,
  37. wins = 0,
  38. loses = 0,
  39. disconnects = 0,
  40. points = 0,
  41. average_time = 0
  42. }).
  43. -record(pointing_rule, {?ITERATOR(feed),
  44. pointing_rule_id, %% {Game, GameType, Rounds} | {Game, GameType}
  45. game,
  46. game_type,
  47. rounds, %% rounds | points | undefined
  48. kakush_winner, %% kakush points will be assigned for the winner of the game.
  49. kakush_other, %% kakush points will be assigned for the rest of the
  50. quota,
  51. game_points}).
  52. -endif.