/* Blinker
Copyright 2011-2019 Stefan Schuermans <stefan@blinkenarea.org>
Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
a blinkenarea.org project */
#include <cmath>
#include <stdlib.h>
#include <string>
#include <vector>
#include <BlinkenLib/BlinkenFrame.h>
#include "File.h"
#include "Format.h"
#include "FormatFile.h"
#include "Game.h"
#include "Mgrs.h"
#include "Module.h"
#include "NameFile.h"
#include "OpConn.h"
#include "OpConnIf.h"
#include "OpReqIf.h"
#include "OutStreamFile.h"
#include "Tetris.h"
#include "Time.h"
#include "TimeCallee.h"
#include "UIntFile.h"
namespace Blinker {
/**
* @brief constructor
* @param[in] name module name
* @param[in] mgrs managers
* @param[in] dirBase base directory
*/
Tetris::Tetris(const std::string &name, Mgrs &mgrs, const Directory &dirBase):
Game(name, mgrs, dirBase),
m_fileStoneColor(dirBase.getFile("stoneColor")),
m_fileDelay(dirBase.getFile("delay")),
m_fileStartSound(dirBase.getFile("startSound")),
m_stoneColor(),
m_delay(c_delayDescr.default_),
m_pConn(NULL),
m_stone(-1), m_rot(-1), m_posX(-1), m_posY(-1), m_field()
{
// open operator connection interfaces for player
m_mgrs.m_opMgr.open(m_name, this);
}
/// virtual destructor