{"size": 970, "ext": "js", "max_stars_repo_path": "app/js/stores/menu/mapMode.js", "max_stars_repo_name": "VXZ/Lacuna-Web-Client", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/js/stores/menu/mapMode.js", "max_issues_repo_name": "VXZ/Lacuna-Web-Client", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/js/stores/menu/mapMode.js", "max_forks_repo_name": "VXZ/Lacuna-Web-Client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.5581395349, "max_line_length": 92, "alphanum_fraction": 0.6546391753}
'use strict';

var Reflux = require('reflux');

var MapActions = require('js/actions/menu/map');

var PLANET_MAP_MODE = 'planetMap';
var STAR_MAP_MODE = 'starMap';

var MapModeStore = Reflux.createStore({
    listenables: MapActions,

    mapMode: undefined,

    getInitialState: function() {
        this.mapMode = PLANET_MAP_MODE;
        return this.mapMode;
    },

    setMapMode: function(mapMode) {
        if (mapMode !== this.mapMode) {
            this.mapMode = mapMode;
            this.trigger(this.mapMode);
        }
    },

    onShowPlanetMap: function() {
        this.setMapMode(PLANET_MAP_MODE);
    },

    onShowStarMap: function() {
        this.setMapMode(STAR_MAP_MODE);
    },

    onToggleMapMode: function() {
        this.setMapMode(this.mapMode === PLANET_MAP_MODE ? STAR_MAP_MODE : PLANET_MAP_MODE);
    }
});

module.exports = MapModeStore;
module.exports.PLANET_MAP_MODE = PLANET_MAP_MODE;
module.exports.STAR_MAP_MODE = STAR_MAP_MODE;
