本文整理汇总了C++中Mover::SetFunctionType方法的典型用法代码示例。如果您正苦于以下问题:C++ Mover::SetFunctionType方法的具体用法?C++ Mover::SetFunctionType怎么用?C++ Mover::SetFunctionType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mover
的用法示例。
在下文中一共展示了Mover::SetFunctionType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OpenLevelFromFile
bool LevelFileIO::OpenLevelFromFile(const char * cFilePath, LevelScene * pScene){
if(pScene && pScene->GridOk()){
ifstream FileIn(cFilePath);
if(FileIn.is_open()){
string LineReader;
FileIn >> LineReader;
if(LineReader == "Foof72"){
int GridWidth = 0, GridHeight = 0;
FileIn >> GridWidth;
FileIn >> GridHeight;
pScene->InitializeGrid(GridWidth, GridHeight);
for(int y = 0; y < GridHeight; y++){
//const int YSkip = y * GridWidth;
for(int x = 0; x < GridWidth; x++){
//const int Index = YSkip + x;
int GridValue = 0;
FileIn >> GridValue;
pScene->SetGridUnit(x,y,GridValue);
}
}
//Then Player
float PlayerX, PlayerY;
FileIn >> PlayerX;
FileIn >> PlayerY;
pScene->SetPlayerStart(PlayerX, PlayerY);
pScene->ResetPlayerPosition();
FileIn >> pScene->ExitPos_X >> pScene->ExitPos_Y;
//Then props if any
//Ignore grand object total
int nProps = 0;
FileIn >> nProps;
FileIn >> nProps;
if(nProps > 0){
for(int i = 0; i < nProps; i++){
PropStruct * pProp = new PropStruct;
pProp->bIsSelected = false;
FileIn >> pProp->uType;
pProp->uType++;
FileIn >> pProp->x;
FileIn >> pProp->y;
pProp->nID = pScene->PropList.size();
pProp->uObjectType = PropStruct::Collectible;
pScene->PropList.push_back(pProp);
}
}
int nEnemies = 0;
FileIn >> nEnemies;
if(nEnemies > 0){
for(int i = 0; i < nEnemies; i++){
PropStruct * pProp = NULL;
unsigned int Type = 0;
float X = 0.0f, Y = 0.0f;
FileIn >> Type;
FileIn >> X;
FileIn >> Y;
ExtendedObject * ExtendedInfo = Globals::DynamicSet[Type];
switch(ExtendedInfo->SubType){
case 2:{
pProp = new Mover;
Mover * pMover = (Mover*)pProp;
float Speed, Width, Pause;
unsigned int FunctionType, MoverType;
FileIn >> FunctionType
>> MoverType
>> pMover->OriginX
>> pMover->OriginY
>> Speed
>> Width
>> Pause
>> pMover->Sync;
pMover->SetSpeed(Speed);
pMover->SetPause(Pause);
pMover->SetWidth(Width);
pMover->SetMoverType(MoverType);
pMover->SetFunctionType(FunctionType);
break;
}
case 3:{
pProp = new PropStruct;
break;
}
case 0:{
pProp = new PropStruct;
float Eater;
FileIn >> Eater >> Eater;
break;
}
case 5:{
pProp = new PropStruct;
float Eater;
FileIn >> Eater >> Eater;
break;
}
//.........这里部分代码省略.........