123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- /**
- * Triangles
- * Copyright (C) 2016 POSITIVE MENTAL ATTITUDE
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 3 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- #pragma once
- #include <SFML/Window.hpp>
- #include "Assets.hpp"
- #include "TrianglesWindow.hpp"
- #include "Context.hpp"
- /**
- * @class State
- * @author POSITIVE MENTAL ATTITUDE
- * @date 06/09/16
- * @file State.hpp
- * @brief This is an abstract base state class.
- */
- class State
- {
- public:
- enum {
- Ongoing = -1, Loading = 0, Menu = 1, Ingame = 2, Empty = 3
- };
- State();
- virtual ~State();
- void setContext(Context* context);
- virtual void init() = 0;
- virtual void refresh() = 0;
- virtual void coreThink(const sf::Event& event) = 0;
- virtual void coreInput() = 0;
- virtual void coreUpdate(sf::Time delta) = 0;
- virtual void coreRender(const bool shaders) = 0;
- const int status() const;
- protected:
- Context* _context;
- int _status;
- };
|