File: cursor.h

package info (click to toggle)
liquidwar 5.6.4-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 15,912 kB
  • ctags: 2,624
  • sloc: ansic: 25,422; xml: 3,985; sh: 3,355; makefile: 1,378; asm: 1,344; python: 537; php: 486; sql: 22
file content (137 lines) | stat: -rw-r--r-- 5,975 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/********************************************************************/
/*                                                                  */
/*            L   I  QQ  U U I DD    W   W  A  RR    555            */
/*            L   I Q  Q U U I D D   W   W A A R R   5              */
/*            L   I Q  Q U U I D D   W W W AAA RR    55             */
/*            L   I Q Q  U U I D D   WW WW A A R R     5            */
/*            LLL I  Q Q  U  I DD    W   W A A R R   55             */
/*                                                                  */
/*                             b                                    */
/*                             bb  y y                              */
/*                             b b yyy                              */
/*                             bb    y                              */
/*                                 yy                               */
/*                                                                  */
/*                     U U       FFF  O   O  TTT                    */
/*                     U U       F   O O O O  T                     */
/*                     U U TIRET FF  O O O O  T                     */
/*                     U U       F   O O O O  T                     */
/*                      U        F    O   O   T                     */
/*                                                                  */
/********************************************************************/

/*****************************************************************************/
/* Liquid War is a multiplayer wargame                                       */
/* Copyright (C) 1998-2007 Christian Mauduit                                 */
/*                                                                           */
/* 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      */
/* the Free Software Foundation; either version 2 of the License, or         */
/* (at your option) any later version.                                       */
/*                                                                           */
/* 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, write to the Free Software               */
/* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
/*                                                                           */
/* Liquid War homepage : http://www.ufoot.org/liquidwar/v5                   */
/* Contact author      : ufoot@ufoot.org                                     */
/*****************************************************************************/

/********************************************************************/
/* nom           : cursor.h                                         */
/* contenu       : placement et initialisation des curseurs         */
/* date de modif : 3 mai 98                                         */
/********************************************************************/

#ifndef LIQUID_WAR_INCLUDE_CURSOR
#define LIQUID_WAR_INCLUDE_CURSOR

/*==================================================================*/
/* includes                                                         */
/*==================================================================*/

#include "base.h"

/*==================================================================*/
/* types                                                            */
/*==================================================================*/

typedef struct
{
  /*
   * value which will be used when the
   * will be put into the map. this  
   * value decreases at each round.  
   */
  int val;
  /* x position of the cursor         */
  int x;
  /* y position of the cursor         */
  int y;
  /* 
   * true if the player who owns this 
   * cursor is playing with it        
   */
  int active;
  /* team the cursor belongs to       */
  int team;
  /* 
   * time at which this cursor has    
   * lost. it seems that the diff     
   * between cursor and team is not   
   * well defined 8-(                 
   */
  int loose_time;
  /* wether you are 1st or 2nd...     */
  int score_order;
  /* 
   * first color used by this cursor  
   * in the 256 color palette. again  
   * a cursor is associated to a team 
   */
  int color_entry;
  /* 
   *      this value holds the state of all
   * the keys associated to the cursor
   * it is a logical or between   
   * - CURSOR_KEY_UP    
   * - CURSOR_KEY_RIGHT 
   * - CURSOR_KEY_DOWN  
   * - CURSOR_KEY_LEFT  
   * which are defined in move.h      
   */
  int key_state;
  /* true if the player is a computer */
  int control_type;
  /* 
   * true if the player is located on 
   * a remote machine                 
   */
  int from_network;
  /*
   * the name of the player
   */
  char name[NAME_SIZE + 1];
}
CURSOR;

/*==================================================================*/
/* variables globales                                               */
/*==================================================================*/

extern CURSOR CURRENT_CURSOR[NB_TEAMS];

/*==================================================================*/
/* fonctions globales                                               */
/*==================================================================*/

void reset_all_cursor (void);
void apply_all_cursor (void);
void auto_cursor (int index, int team, char *name);

#endif