Map names now stored based on stage plate names provided. Made unlock conditions based on their actual unlock conditions and not the names of the plates.

This commit is contained in:
2023-11-16 19:24:02 -06:00
parent 008f6a28f6
commit ce3be8b05d
11 changed files with 45 additions and 41 deletions
+13
View File
@@ -29,11 +29,14 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
#include "Crawler.h"
#include "GameState.h"
#include "State_GameRun.h"
#include "State_OverworldMap.h"
#include "State_MainMenu.h"
INCLUDE_game
#define NEW_STATE(state,class) GameState::states[state]=NEW class();
void GameState::Initialize(){
@@ -44,4 +47,14 @@ void GameState::Initialize(){
GameState::ChangeState(States::OVERWORLD_MAP);
}
void GameState::ChangeState(States::State newState){
GameState*prevState=STATE;
if(!states.count(newState)){
ERR("WARNING! State not defined for state "<<newState<<"!")
}
STATE=states.at(newState);
game->camera.SetTarget(game->GetPlayer()->GetPos());
STATE->OnStateChange(prevState);
}
GameState::~GameState(){}