float point exception, waiting for debugging
This commit is contained in:
67
src/constants.h
Normal file
67
src/constants.h
Normal file
@ -0,0 +1,67 @@
|
||||
// TODO: Consider moving the contents of this header to their relevant
|
||||
// headers
|
||||
|
||||
#ifndef __CONSTANTS_H__
|
||||
#define __CONSTANTS_H__
|
||||
#include <vector>
|
||||
#include "position.h"
|
||||
|
||||
// IMPORTANT: added END to the end of all valued enums so that you can
|
||||
// iterate over them
|
||||
|
||||
enum error {none};
|
||||
|
||||
// TODO: update result to include subject
|
||||
enum result {fine, died, go_down, hit, moved};
|
||||
|
||||
enum stat_name {HP, ATK, DEF, hostile};
|
||||
|
||||
const int LAYER_CNT = 4; // TODO: update as you go
|
||||
enum layer_num {map = 0, objects, characters, shop};
|
||||
|
||||
const int RACE_CNT = 2; // TODO: update as you go
|
||||
|
||||
enum race {unknown = 0, rshade /* TODO: fill out the other races (including enemies) */};
|
||||
|
||||
// TODO: fill out the other races (including enemies)
|
||||
const int MAX_HP[RACE_CNT] = {0, 125};
|
||||
const int STARTING_HP[RACE_CNT] = {0, 125};
|
||||
const int STARTING_ATK[RACE_CNT] = {0, 25};
|
||||
const int STARTING_DEF[RACE_CNT] = {0, 25};
|
||||
const char CHARACTER_REP[RACE_CNT] = {'@', 'S'};
|
||||
|
||||
const int DIRECTION_CNT = 8;
|
||||
// IMPORTANT: east is positive for x and SOUTH is positive for y
|
||||
// initializes all directions to an int
|
||||
enum direction {east = 0, west, north, south, northeast,
|
||||
northwest, southeast, southest
|
||||
};
|
||||
|
||||
const position MOVE[DIRECTION_CNT] = {
|
||||
{1, 0}, {-1, 0}, {0, -1}, {0, 1},
|
||||
{1, -1}, {-1, -1}, {1, 1}, {-1, 1}
|
||||
};
|
||||
|
||||
const int MAP_HEIGHT = 25;
|
||||
const int MAP_WIDTH = 79;
|
||||
const int DISPLAY_HEIGHT = 30;
|
||||
const int DISPLAY_WIDTH = 79;
|
||||
|
||||
// TODO: list all extra features
|
||||
// using constants to keep track of features
|
||||
// method: features: FEATURE_XXX | FEATURE_YYY
|
||||
// That is: use bit manipulation
|
||||
// check if feature is enabled:
|
||||
// features & FEATURE_XXX
|
||||
typedef unsigned int feature; // can extend to unsigned long (long) if needed
|
||||
const feature FEATURE_NCURSES = 1 << 0;
|
||||
const feature FEATURE_RAND_MAP = 1 << 1;
|
||||
const feature FEATURE_ENEMIES_CHASE = 1 << 2;
|
||||
const feature FEATURE_INVENTORY = 1 << 3;
|
||||
const feature FEATURE_THROW = 1 << 4;
|
||||
const feature FEATURE_REVISIT = 1 << 5;
|
||||
|
||||
typedef std::vector<position> position_list;
|
||||
typedef std::vector<direction> direction_list;
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user