当前位置: 首页>>代码示例>>C++>>正文


C++ Level::ReturnState方法代码示例

本文整理汇总了C++中Level::ReturnState方法的典型用法代码示例。如果您正苦于以下问题:C++ Level::ReturnState方法的具体用法?C++ Level::ReturnState怎么用?C++ Level::ReturnState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Level的用法示例。


在下文中一共展示了Level::ReturnState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main ( int argc, char** argv )
{
    fflush (stdout); // Enable console output, SDL disables this
    vector<Character*> party;
    vector<Character*> badguys;
    vector<Point> start;
    vector<Tile*> tiles;
    Tile* tile = new Tile(Point(0,0), "GRASS");
    tiles.push_back(tile);
    tile = new Tile(Point(1,0), "GRASS");
    tiles.push_back(tile);
    tile = new Tile(Point(2,0), "GRASS");
    tiles.push_back(tile);
    tile = new Tile(Point(0,1), "GRASS");
    tiles.push_back(tile);
    tile = new Tile(Point(1,1), "GRASS");
    tiles.push_back(tile);
    tile = new Tile(Point(2,1), "GRASS");
    tiles.push_back(tile);
    tile = new Tile(Point(0,2), "GRASS");
    tiles.push_back(tile);
    tile = new Tile(Point(1,2), "GRASS");
    tiles.push_back(tile);
    tile = new Tile(Point(2,2), "GRASS");
    tiles.push_back(tile);
    start.push_back(Point(0,0));
    Knight* knight = new Knight("dumb", 20, NULL, NULL);
    party.push_back(knight);
    Knight* knight2 = new Knight("dumb", 1, NULL, NULL);
    knight2->Move(Point(3,3));
    badguys.push_back(knight2);
    Map* map = new Map(tiles);
    Level bleh = Level(party, badguys, start, map);
    cout << bleh.OnSelect(Point(0,1)) << endl;
    cout << bleh.ReturnState() << endl;
    Character* meh = bleh.OnSelect(Point(0,0));
    cout << meh->GetAttr(Character::AGI) <<endl;
    /*cout << bleh.ReturnState() << endl;
    cout <<bleh.OnSelect(Point(0,1)) << endl;
    cout <<bleh.OnSelect(Point(0,1)) << endl;
    bleh.TakeTurn();
    bleh.TakeTurn();
    cout << bleh.OnSelect(Point(0,1)) << endl;
    cout << bleh.OnSelect(Point(1,1)) << endl;
    cout << bleh.ReturnState() << endl;
    bleh.TakeTurn();
    bleh.TakeTurn();
    */
    cout << bleh.OnSelect(Point(3,2)) << endl;
    cout << bleh.ReturnState() << endl;
    cout << bleh.OnSelect(Point(3,3)) << endl;
    cout << bleh.GetLoseCondition() << endl;
    cout << bleh.GetWinCondition() << endl;
    bleh.TakeTurn();
    bleh.TakeTurn();
    Character* chara = bleh.OnSelect(Point(3,2));
    cout << chara->GetExp() << endl;
    /*bleh.TakeTurn();
    bleh.TakeTurn();
    cout << bleh.OnSelect(Point(3,2)) << endl;
    cout << bleh.OnSelect(Point(3,2)) << endl;
    */
/*
    GameRoot ourGame;

    ourGame.Initialize();

    ourGame.GameLoop();

    ourGame.Shutdown();

    return 0;
    */
}
开发者ID:cebuking0,项目名称:undefined,代码行数:74,代码来源:LevelTestMain.cpp


注:本文中的Level::ReturnState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。