solo.h 2.76 KB
Newer Older
Vivien Kraus's avatar
Vivien Kraus committed
1
/* tarot implements the rules of the tarot game
2
 * Copyright (C) 2019, 2020  Vivien Kraus
Vivien Kraus's avatar
Vivien Kraus committed
3
4
5
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation, version 3 of the License.
Vivien Kraus's avatar
Vivien Kraus committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef H_TAROT_SOLO_INCLUDED
#define H_TAROT_SOLO_INCLUDED

#include <stddef.h>
#include <tarot/game.h>
#include <tarot/player.h>
#include <tarot/cards.h>
24
#include <tarot/ai.h>
Vivien Kraus's avatar
Vivien Kraus committed
25
26
27
28
29
30
31
32
33
34
35
36
37

#ifdef __cplusplus
extern "C"
{
#endif                          /* __cplusplus */

  struct TarotSolo;
  typedef struct TarotSolo TarotSolo;

  /**
   * tarot_solo_alloc: (constructor)
   */
  TarotSolo *tarot_solo_alloc (void);
38
39
40
41

  /**
   * tarot_solo_alloc_fuzzy: (constructor)
   * @seed: (array length=seed_size) (element-type char):
42
   * @ai: (nullable):
43
44
45
46
   */
  TarotSolo *tarot_solo_alloc_fuzzy (double fuzziness, size_t seed_size,
                                     const void *seed, const TarotAi * ai);

Vivien Kraus's avatar
Vivien Kraus committed
47
48
  TarotSolo *tarot_solo_dup (const TarotSolo * source);
  void tarot_solo_free (TarotSolo * solo);
Vivien Kraus's avatar
Vivien Kraus committed
49
50

  void tarot_solo_copy (TarotSolo * dest, const TarotSolo * source);
Vivien Kraus's avatar
Vivien Kraus committed
51
52
53
54
  void tarot_solo_copy_as (TarotSolo * dest, const TarotSolo * source,
                           TarotPlayer who);
  void tarot_solo_get (const TarotSolo * solo, TarotGame * game);
  TarotGame *tarot_solo_get_alloc (const TarotSolo * solo);
Vivien Kraus's avatar
Vivien Kraus committed
55
56
57

  /**
   * tarot_solo_setup:
Vivien Kraus's avatar
Vivien Kraus committed
58
   * @owners: (array length=n_owners):
Vivien Kraus's avatar
Vivien Kraus committed
59
60
   * @with_call: (type boolean):
   */
Vivien Kraus's avatar
Vivien Kraus committed
61
62
63
64
65
  TarotGameError tarot_solo_setup (TarotSolo * solo, size_t n_players,
                                   int with_call, TarotPlayer myself,
                                   size_t n_owners,
                                   const TarotPlayer * owners,
                                   TarotPlayer taker, TarotCard call);
Vivien Kraus's avatar
Vivien Kraus committed
66
67
68
69
70
71

  /**
   * tarot_solo_setup_random:
   * @seed: (array length=seed_size) (type char):
   * @with_call: (type boolean):
   */
Vivien Kraus's avatar
Vivien Kraus committed
72
73
74
75
76
  TarotGameError tarot_solo_setup_random (TarotSolo * solo, size_t n_players,
                                          int with_call, size_t seed_size,
                                          const void *seed);
  TarotGameError tarot_solo_add (TarotSolo * solo,
                                 const TarotGameEvent * event);
Vivien Kraus's avatar
Vivien Kraus committed
77
78
79
80
81
82

#ifdef __cplusplus
}
#endif                          /* __cplusplus */

#endif                          /* not H_TAROT_SOLO_INCLUDED */