PFC/Omweso/src/ow_board.h

00001 /***************************************************************************
00002  *   Copyright (C) 2007 by David Torres   *
00003  *   aiken669@gmail.com   *
00004  ***************************************************************************/
00005 #ifndef STDOW_TABLERO_H
00006 #define STDOW_TABLERO_H
00007 
00008 #include <string>
00009 #include <SDL/SDL.h>
00010 #include <SDL/SDL_ttf.h>
00011 #include "omweso.h"
00012 #include "ow_cell.h"
00013 
00014 using namespace std;
00015 
00020 class ow_board{
00021 private:
00022      int status;
00023      int brd_num_cols;
00024      int movecount, movecurrent;
00025      cellXY moveini;
00026      cellXY movestep;
00027      int sowing_delay, board_sowing_delay;
00028      int handseeds;
00029      int turnchains;
00030      int gfxdata_loaded;
00031   SDL_Surface *gfxdata[3];
00032   SDL_Palette *plt;
00033      TTF_Font *font;
00034      void display_errormove(int boardside, int cellx, int celly);
00035      int _move(int boardside, int cellx, int celly);
00036      void update_status_actions();
00037      int ntakeseeds(int seeds, int boardside, int cellx, int celly);
00038      int nputseeds(int seeds, int boardside, int cellx, int celly);
00039      
00040      int saveundo();int undo_active;
00041      int undodata[BRD_MAX_UNDO_MOVES][BRD_NUM_SIDES][BRD_MAX_COLS_PER_PLAYER][BRD_MAX_ROWS_PER_PLAYER];
00042      int backupsaved;
00043      int backupdata[BRD_NUM_SIDES][BRD_MAX_COLS_PER_PLAYER][BRD_MAX_ROWS_PER_PLAYER];
00044 
00045 public:
00046   ow_cell *bcells[BRD_NUM_SIDES][BRD_MAX_COLS_PER_PLAYER][BRD_MAX_ROWS_PER_PLAYER]; 
00047 
00048   ow_board(int columns);
00049      ow_board(ow_board *board);
00050 
00051      void suggested_beginners_seeds_initial_setup();
00052 
00053   int load_gfxdata();
00054   SDL_Palette *get_palette();
00055 
00056   void draw_gfx(SDL_Surface *surface);
00057      void draw_txt();
00058      int move(int boardside, int cellx, int celly);
00059      int move_d(int boardside, int cellx, int celly);
00060      int rcapture(int boardside, int cellx, int celly);
00061      int rcapture_d(int boardside, int cellx, int celly);
00062      int capture();
00063      int takeseeds(int boardside, int cellx, int celly);
00064      int countseeds(int boardside, int cellx, int celly);
00065      int countseeds(int boardside);
00066      int initialboard_countseeds(int boardside, int cellx, int celly);
00067      int initialboard_reset();
00068      int initialboard_setcurrent();
00069 
00070      int bsetup_takeseeds(int seeds, int boardside, int cellx, int celly);
00071      int bsetup_putseeds(int seeds, int boardside, int cellx, int celly);
00072 
00073      int checkavailablemoves(int boardside);
00074      int checkmove(int boardside, int cellx, int celly);
00075      int checkrcapture(int boardside, int cellx, int celly);
00076      void set_undo_mode(int status);
00077      int undolastmove(int nummoves);
00078 
00079      int savebackup();
00080      int restorebackup();
00081 
00082      int endofturn();
00083      void clear_status_actions();
00084      int update_status();
00085      int getcolcount();
00086      int counthandseeds();
00087      int setcellseeds(int seeds, int boardside, int cellx, int celly);
00088      //int setcellstatus(int status, int boardside, int cellx, int celly);
00089      //int setcellaction(int action, int boardside, int cellx, int celly);
00090      void setboardspeed(int bspeed);
00091      string translate_coord2name(int boardside, int cellx, int celly);
00092 
00093   ~ow_board();
00094 };
00095 
00096 #endif

Generated on Sun Jun 22 13:45:47 2008 for Omweso by  doxygen 1.5.3