当我编译有一个错误调用“错误C2061:语法错误:标识符'Player'”
我无法弄清楚我的代码有什么问题。这是我的代码
#include "Platform.h" #include "Player.h" class Collision { public: Collision(void); ~Collision(void); static bool IsCollision(Player &player, Platform& platform); };
“IsCollision”方法中存在错误。
播放器.h
#include <SFML/Graphics.hpp>
#include "rapidxml.hpp"
#include <fstream>
#include <iostream>
#include "Collision.h"
using namespace rapidxml;
class Player
{
private:
sf::Texture playerTexture;
sf::Sprite playerSprite;
sf::Vector2u position;
sf::Vector2u source;
sf::Vector2u size;
int frameCounter, switchFrame, frameSpeed;
int walkSpriteWidth;
float velocity;
bool isWalk;
bool isStand;
bool isFaceRight;
public:
Player(void);
~Player(void);
void Init();
void Draw(sf::RenderWindow *window);
void MoveForward();
void MoveBackward();
void Update(sf::Clock *clock);
void SetSourceY(int value);
void SetWalk(bool value);
void SetFacing(std::string value);
void SetStand(bool value);
void Stand();
std::string GetStatus();
void PrintStatus();
sf::Vector2f GetPosition();
int GetWidth();
int GetHeight();
};