This repository has been archived on 2020-09-30. You can view files and clone it, but cannot push or open issues or pull requests.
2020-09-29 08:52:39 +00:00
|
|
|
import React, { Fragment } from "react";
|
2020-09-29 09:31:55 +00:00
|
|
|
import { useSelector } from "react-redux";
|
|
|
|
import { SceneStore } from "~store/scene/reducer";
|
|
|
|
import { GameStore } from "~store/state";
|
|
|
|
import MapEditor from "~game/scenes/MapEditor";
|
2020-09-29 08:52:39 +00:00
|
|
|
|
|
|
|
export default function Game() {
|
2020-09-29 09:31:55 +00:00
|
|
|
const scene = useSelector<GameStore, SceneStore>((state) => state.scene);
|
|
|
|
switch (scene.type) {
|
|
|
|
case "MapEditor":
|
|
|
|
return <MapEditor />;
|
|
|
|
default:
|
|
|
|
// Bad case, should have something to show just in case!
|
|
|
|
return <Fragment></Fragment>;
|
2020-09-29 08:52:39 +00:00
|
|
|
}
|
|
|
|
}
|