solo.h 3.04 KB
Newer Older
Vivien Kraus's avatar
Vivien Kraus committed
1
2
3
4
5
/* tarot implements the rules of the tarot game
 * Copyright (C) 2019  Vivien Kraus
 *
 * 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
42
43
44
45

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

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

  /**
   * tarot_solo_construct:
   * @max_mem: available number of bytes in @mem
   * @mem_out: (array length=max_mem): available aligned memory
   * @alignment: (out): the game alignment
   */
Vivien Kraus's avatar
Vivien Kraus committed
55
56
  size_t tarot_solo_construct (size_t max_mem, char *mem_out,
                               size_t *alignment);
Vivien Kraus's avatar
Vivien Kraus committed
57
58

  void tarot_solo_copy (TarotSolo * dest, const TarotSolo * source);
Vivien Kraus's avatar
Vivien Kraus committed
59
60
61
62
  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
63
64
65

  /**
   * tarot_solo_setup:
Vivien Kraus's avatar
Vivien Kraus committed
66
   * @owners: (array length=n_owners):
Vivien Kraus's avatar
Vivien Kraus committed
67
68
   * @with_call: (type boolean):
   */
Vivien Kraus's avatar
Vivien Kraus committed
69
70
71
72
73
  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
74
75
76
77
78
79

  /**
   * tarot_solo_setup_random:
   * @seed: (array length=seed_size) (type char):
   * @with_call: (type boolean):
   */
Vivien Kraus's avatar
Vivien Kraus committed
80
81
82
83
84
  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
85
86
87
88
89
90

#ifdef __cplusplus
}
#endif                          /* __cplusplus */

#endif                          /* not H_TAROT_SOLO_INCLUDED */