CCelledMapGenerator Class Reference

CTileArranger와 CKeyLockComposer의 결과를 받아서 Cell 단위 level을 생성한다. More...

#include <CelledMapGenerator.h>

List of all members.

Public Member Functions

int Process (CKeyLockComposer *pKeyLockComposer)
 CKeyLockComposer의 instance를 받아서 cell 단위 level을 생성한다.
void Export (ostream &os)
 level 생성 결과를 XML로 출력한다.

Private Member Functions

void GetCelledCoor (int slotX, int slotY, int inSlotX, int inSlotY, int *x, int *y)
 slot 좌표와 slot 내부의 cell 좌표를 받아서 전체 level에서의 cell 좌표를 반환한다.
void ConvertToInSlotCellCoor (int cellX, int cellY, int *x, int *y)
 전체 level에서의 cell 좌표를 받아서 slot 내부에서의 cell 좌표로 반환한다.
bool IsAttainbleCell (int slotX, int slotY, int inSlotX, int inSlotY)
 slot 내부의 특정 cell이 도달 가능한 type인지 반환한다.
int AllocateKey (int index, Direction::Type dir)
 slot 내부의 cell 좌표에 key를 할당한다.
int AllocateSokobanBlock ()
 slot 내부의 cell 좌표에 sokoban block을 배치한다.
int BuildSlotSolutionPath ()
 slot 단위의 solution path를 생성한다.
int AppendSlotSolutionPath (TiledGraph &g, int startX, int startY, int goalX, int goalY)
 시작 Slot에서 목표 Slot까지 이동하는 경로를 solution path 에 추가한다.
int BuildCellSolutionPath ()
 cell 단위의 solution path를 생성한다.
int AppendCellSolutionPath (int startX, int startY, int goalX, int goalY, int slotX, int slotY)
 Slot 내부에서 시작 cell에서 목표 cell까지 이동하는 경로를 solution path 에 추가한다.
int AllocateMonsters ()
 cell 단위의 solution path를 따라 monster를 배치한다.

Private Attributes

COOR_SET m_coorSet
 key, lock, sokoban block 등이 같은 cell에 중복되어 배치되는 것을 막기 위해 사용된 cell의 목록을 유지
COOR_SET m_moveSet
 cell 단위의 solution path를 따라 monster를 배치할 때 이미 solution path에 한번 나왔던 cell이면 monster를 배치하지 않도록 하기 위해


Detailed Description

CTileArranger와 CKeyLockComposer의 결과를 받아서 Cell 단위 level을 생성한다.

이전 단계에서는 slot 단위의 matrix를 이용하여 level을 표현한다. 이 단계에서는 각 slot을 tile로 replace하여 cell단위의 matrix를 생성한다.


Member Function Documentation

int CCelledMapGenerator::Process ( CKeyLockComposer pKeyLockComposer  ) 

CKeyLockComposer의 instance를 받아서 cell 단위 level을 생성한다.

Parameters:
pKeyLockComposer CKeyLockComposer의 instance
Returns:
에러 코드

int CCelledMapGenerator::AllocateKey ( int  index,
Direction::Type  dir 
) [private]

slot 내부의 cell 좌표에 key를 할당한다.

direction이 인자로 필요한 이유는 slot에 들어오는 방향에 따라 도달 가능한 cell 이 달라지기 때문이다.

Parameters:
index key의index
dir Slot에 들어오는 방향
Returns:
에러 코드


The documentation for this class was generated from the following files:
Generated on Wed Dec 19 12:25:56 2007 for Random Level Generator by  doxygen 1.5.4