|
Revision 12838, 0.6 kB
(checked in by tosik, 5 years ago)
|
|
hebilife : updated some comments
|
-
Property svn:eol-style set to
CRLF
|
| Line | |
|---|
| 1 | #pragma once
|
|---|
| 2 |
|
|---|
| 3 | class Snake;
|
|---|
| 4 |
|
|---|
| 5 | // Snake�������class Field
|
|---|
| 6 | {
|
|---|
| 7 | public:
|
|---|
| 8 | Field();
|
|---|
| 9 | ~Field();
|
|---|
| 10 |
|
|---|
| 11 | void makeSnake();
|
|---|
| 12 | void makeSnake(Snake *s);
|
|---|
| 13 | void step();
|
|---|
| 14 | void view();
|
|---|
| 15 |
|
|---|
| 16 | bool isDead(int id);
|
|---|
| 17 | bool canEat(int id);
|
|---|
| 18 |
|
|---|
| 19 | int random(int n);
|
|---|
| 20 |
|
|---|
| 21 | static const int CNT_MAX = 1000;
|
|---|
| 22 | static const int LENGTH_MAX = 10;
|
|---|
| 23 |
|
|---|
| 24 | Snake *snake[CNT_MAX];
|
|---|
| 25 | int cnt;
|
|---|
| 26 |
|
|---|
| 27 | int steps;
|
|---|
| 28 |
|
|---|
| 29 | const static int size_x = 45;
|
|---|
| 30 | const static int size_y = 50;
|
|---|
| 31 |
|
|---|
| 32 | int bodies[size_x][size_y];
|
|---|
| 33 | bool foods[size_x][size_y];
|
|---|
| 34 | int wall[size_x][size_y];
|
|---|
| 35 |
|
|---|
| 36 | bool getHazard(int x, int y);
|
|---|
| 37 | int getBodies(int x, int y);
|
|---|
| 38 | int getFoods(int x, int y);
|
|---|
| 39 | };
|
|---|
| 40 |
|
|---|