#pragma once
#include "gamestate.h"
#include "gameobject.h"


#include <list>
#include <string>
#include <vector>


class Player;

class Level
{

  public:

    std::list<GameObject*>      Objects;

    Player*                     pPlayer;

    std::string                 Info;



    Level();
    ~Level();

    void            ClearObjects();
    void            Display();
    void            UpdateFrame( const float fElapsedTime );


    bool            MoveObject( GameObject* pObj, float DX, float DY );
    bool            CanMove( GameObject* pObj, int DX, int DY );

    bool            Load( int Nr );

    bool            ReadLine( FILE* f, std::string& Line );
    void            SplitString( const std::string& Source, char Separator, std::vector<std::string>& Values );

    GameObject*     SpawnObject( const std::string& Type, int X, int Y, int Width = 0, int Height = 0, float Angle = 0.0f );
    GameObject*     SpawnObject( const std::string& Type, int X, int Y, float Size );

    int             IntValue( const std::string& Text, int Min, int Max );

    bool            IsAreaBlocked( GameObject* pObj, RECT& Bounds );

    void            SpawnParticles( int Num, int X, int Y, unsigned int Color );

};
