#include "Game/MainMenu/Scene.hpp"

using namespace cocos2d;

namespace MainMenu
{
    cocos2d::Scene* CScene::createScene()
    {
        return CScene::create();
    }
    
    bool CScene::init()
    {
        if (!Scene::init())
        {
            return false;
        }
        
        // Create touch listener and register it with cocos2d to receive touch events
        EventListenerTouchOneByOne* touchDelegate = EventListenerTouchOneByOne::create();
        touchDelegate->onTouchBegan = std::bind(&CScene::touchBegan, this, std::placeholders::_1, std::placeholders::_2);
        touchDelegate->onTouchMoved = std::bind(&CScene::touchMoved, this, std::placeholders::_1, std::placeholders::_2);
        touchDelegate->onTouchCancelled = std::bind(&CScene::touchCancelled, this, std::placeholders::_1, std::placeholders::_2);
        touchDelegate->onTouchEnded = std::bind(&CScene::touchEnded, this, std::placeholders::_1, std::placeholders::_2);
        
        Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(touchDelegate, 100);
        
        this->scheduleUpdate();
        
        return true;
    }
    
    void CScene::update(const float kfDeltaTime)
    {
        
    }
    
    bool CScene::touchBegan(cocos2d::Touch* touch, cocos2d::Event* event)
    {
		return false;
    }
    
    void CScene::touchMoved(cocos2d::Touch* touch, cocos2d::Event* event)
    {
        
        
    }
    void CScene::touchEnded(cocos2d::Touch* touch, cocos2d::Event* event)
    {
        
    }
    
    void CScene::touchCancelled(cocos2d::Touch* touch, cocos2d::Event* event)
    {
        
    }
}
