Ncurse interface seems to work...
This commit is contained in:
parent
8656f37eab
commit
dafe6f73ee
4 changed files with 199 additions and 18 deletions
36
include/view.h
Normal file
36
include/view.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
#ifndef VIEW_H
|
||||
#define VIEW_H
|
||||
#include <ncurses.h>
|
||||
#include "common.h"
|
||||
#include "model.h"
|
||||
|
||||
typedef struct view * p_view;
|
||||
|
||||
/*!
|
||||
* This function allocates dynamically a struct view in order to handle the corresponding u_tictactoe.
|
||||
*
|
||||
* \param p_uttt a pointer on a s_utictactoe.
|
||||
* \return a reference to the s_utictactoe memory space allocated, NULL in case
|
||||
* of allocation problem.
|
||||
*/
|
||||
p_view create_view(s_utictactoe * p_uttt);
|
||||
|
||||
void draw_ttt(WINDOW * w, s_tictactoe * t);
|
||||
e_location get_ttt_position( int x, int y);
|
||||
/*!
|
||||
* This function retrieves a valid move proposal from the user using the corresponding view.
|
||||
*
|
||||
* \param p_move a pointer on a s_move to be modified.
|
||||
* \param v a pointer on the view to use.
|
||||
*/
|
||||
void set_next_player_move(s_move * p_move, p_view v);
|
||||
|
||||
/*!
|
||||
* This function free all the memory used by a given view which
|
||||
* reference is given.
|
||||
*
|
||||
* \param v a pointer on a view to be freed.
|
||||
*/
|
||||
void free_view(p_view v);
|
||||
|
||||
#endif /* VIEW_H */
|
Loading…
Add table
Add a link
Reference in a new issue