//! "Pigeon" automata simulator for MotorJ /*! * * "Pigeon" automata simulator for Motorj * * Permits easier simulation of automata in games (e.g. enemies * and other entities that can be described as state machines) * */ /* Copyright (C) 2009-2010 Alejandro Valenzuela Roca, * * This file is part of MotorJ, a free framework for videogame creation. * * * * MotorJ is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MotorJ 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with MotorJ. If not, see . */ #ifndef PIGEON_CLASS_H #define PIGEON_CLASS_H #include #include "pigeonstate-class.h" class mjPigeon{ public: mjPigeon(); //! Perform test and execute proper state void Update(float t_elapsed); //! Test conditions to switch between states virtual int Test() =0; //! Holds the states std::vector states; //! Current state's position in the states vector int currentStateIndex; //! Time spent executing the current state (reset when switching) float timeInCurrentState; //! Current state mjPigeonState* currentStatePtr; }; #endif