关于UML的有关问题!
关于UML的问题!急。
第一次听说UML,就是两天前,要给一段程序画个UML出来
不会啊 急
哪位大哥帮忙画一下啊 会的人应该不难的 因为程序不复杂
我的email:zhougz2000@hotmail.com 加我QQ也行:365640642 谢谢啦 本人比较穷 分不多 多包涵
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
# define LocationEmpty_Code 1
# define LocationTreasure_Code 2
# define LocationTried_Code 3
# define LocationReset_Code 4
class Treasure
{
protected:
int grid;
int **Map;
int Dig_X_Coord;
int Dig_Y_Coord;
int Difficulty;
int TotalMoves;
int MovesSoFar;
int Treasure_X_Coord;
int Treasure_Y_Coord;
bool PlayerWon;
bool PlayerDead ;
public:
Treasure(void);
int getGrid();
int printMap();
int readCoord();
void setGrid(int grid);
void winMessage();
void Dig();
void noTreasureMessage();
void showmenu();
void initMap(int gridSize);
};
Treasure::Treasure(void)
{
srand(time(0));
grid = 7;
PlayerWon = false;
PlayerDead = false;
Difficulty = 10;
TotalMoves = Difficulty;
MovesSoFar = 0;
initMap(grid);
}
void Treasure::initMap(int gridSize)
{
// sets the size of the map
grid = gridSize;
Map = new int*[grid];
//cout < < "setting size of grid to be : \n " < < grid;
for(int x = 0; x < grid; x++)
{
Map[x] = new int[grid];
}
for(int y = 0; y < grid; y++)
{
for(int x = 0; x < grid; x++)
{
Map[x][y] = LocationEmpty_Code;
}
}
Treasure_X_Coord = (int)(rand()%grid);
Treasure_Y_Coord = (int)(rand()%grid);
Map[Treasure_X_Coord][Treasure_Y_Coord] = LocationTreasure_Code;
Dig_X_Coord = LocationReset_Code;
Dig_Y_Coord = LocationReset_Code;
}
int Treasure::readCoord()
{
return 1;
}
int Treasure::getGrid()
{
return grid;
}
void Treasure::winMessage()
{
// thw win message if the treasure is found
第一次听说UML,就是两天前,要给一段程序画个UML出来
不会啊 急
哪位大哥帮忙画一下啊 会的人应该不难的 因为程序不复杂
我的email:zhougz2000@hotmail.com 加我QQ也行:365640642 谢谢啦 本人比较穷 分不多 多包涵
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
# define LocationEmpty_Code 1
# define LocationTreasure_Code 2
# define LocationTried_Code 3
# define LocationReset_Code 4
class Treasure
{
protected:
int grid;
int **Map;
int Dig_X_Coord;
int Dig_Y_Coord;
int Difficulty;
int TotalMoves;
int MovesSoFar;
int Treasure_X_Coord;
int Treasure_Y_Coord;
bool PlayerWon;
bool PlayerDead ;
public:
Treasure(void);
int getGrid();
int printMap();
int readCoord();
void setGrid(int grid);
void winMessage();
void Dig();
void noTreasureMessage();
void showmenu();
void initMap(int gridSize);
};
Treasure::Treasure(void)
{
srand(time(0));
grid = 7;
PlayerWon = false;
PlayerDead = false;
Difficulty = 10;
TotalMoves = Difficulty;
MovesSoFar = 0;
initMap(grid);
}
void Treasure::initMap(int gridSize)
{
// sets the size of the map
grid = gridSize;
Map = new int*[grid];
//cout < < "setting size of grid to be : \n " < < grid;
for(int x = 0; x < grid; x++)
{
Map[x] = new int[grid];
}
for(int y = 0; y < grid; y++)
{
for(int x = 0; x < grid; x++)
{
Map[x][y] = LocationEmpty_Code;
}
}
Treasure_X_Coord = (int)(rand()%grid);
Treasure_Y_Coord = (int)(rand()%grid);
Map[Treasure_X_Coord][Treasure_Y_Coord] = LocationTreasure_Code;
Dig_X_Coord = LocationReset_Code;
Dig_Y_Coord = LocationReset_Code;
}
int Treasure::readCoord()
{
return 1;
}
int Treasure::getGrid()
{
return grid;
}
void Treasure::winMessage()
{
// thw win message if the treasure is found