view linda.h @ 122:5219bf3d5e71

title_draw
author e085768
date Mon, 27 Jun 2011 19:44:46 +0900
parents 0b65ca27f113
children 4f50f5a3b363
line wrap: on
line source

#ifndef LINDA_H
#define LINDA_H


//#include "linda/lindaapi.h"
/*
  +-------+-------+-------+-----------+
  | game  | car   | course| data      |
  | mode  |    id |    id | (fmatrix) |
  +-------+-------+-------+-----------+

       mode : ゲームの状態(オープニング、車選択等)
     car id : ユーザの選んだ車
  course id : 走るコース(1Pのみ選択可能)
       data : ユーザの車の状態(location、angle等)

       ユーザのIDはLinda_IDで判断する
       linda_seq[i]: ユーザID=i
*/

#define MODE_INIT             0
#define MODE_WAIT             1
#define MODE_WAIT_READY       2
#define MODE_OPENING          3
#define MODE_SELECT_CAR       4
#define MODE_SELECT_COURSE    5
#define MODE_READY            6
#define MODE_MAIN_INIT        7
#define MODE_MAIN_READY       8
#define MODE_MAIN             9
#define MODE_MAIN_PAUSE      10
#define MODE_MAIN_GOAL       11
#define MODE_MAIN_FINISH     12
#define MODE_FINISH          13

#define PLAYER_1P 1

#define CLIENT_MAX 2
#define LINDA_ASK_ID 65535
#define LINDA_HOST "firefly.cr.ie.u-ryukyu.ac.jp"


#define PKT_MODE_OFFSET      0
#define PKT_CARID_OFFSET     4
#define PKT_COURSEID_OFFSET  8
#define PKT_DATA_OFFSET     12

#define PKT_HEADER_SIZE     12
#include "game.h"
#include "schedule.h"
#include <stdbool.h>

extern Game *game;

// static を付けてたらwaringが出るから消したけど、問題ある?:miya
void linda_set_schedule(void *func, int mode, Game *game);
bool linda_sche_wait0(int p, Game *game);
bool linda_sche_wait1(int p, Game *game);
bool linda_sche_wait_ready0(int p, Game *game);
bool linda_sche_wait_ready1(int p, Game *game);
bool linda_sche_opening0(int p, Game *game);
bool linda_sche_opening1(int p, Game *game);
bool linda_sche_select_car0(int p, Game *game);
bool linda_sche_select_car1(int p, Game *game);
bool linda_sche_select_course0(int p, Game *game);
bool linda_sche_select_course1(int p, Game *game);
bool linda_sche_ready0(int p, Game *game);
bool linda_sche_ready1(int p, Game *game);
bool linda_sche_main_init(int p, Game *game);
bool linda_sche_main_init(int p, Game *game);
bool linda_sche_main_ready0(int p, Game *game);
bool linda_sche_main_ready1(int p, Game *game);
bool linda_sche_main(int p, Game *game);

int linda_int(Game *game);

// schedule.cで使用してる
void linda_env_init( void );



extern void psx_id(unsigned char *);
extern void psx_linda(unsigned char *);
extern void psx_sync(unsigned char *);
//unsigned char psx_reply(int seq);

#endif