{"size": 581, "ext": "js", "max_stars_repo_path": "server/storm.js", "max_stars_repo_name": "linusromland/Stormworks-HTTPControlled", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/storm.js", "max_issues_repo_name": "linusromland/Stormworks-HTTPControlled", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/storm.js", "max_forks_repo_name": "linusromland/Stormworks-HTTPControlled", "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": 19.3666666667, "max_line_length": 43, "alphanum_fraction": 0.5765920826}
const main = require("./main.js");

let throttle = 0;
let steering = 0;
let brake = 0;

exports.webMessageRecieved = (message) => {
	throttle = message.throttle;
	steering = message.steering;
	brake = message.brake;

	main.emitWebMessage(message);
};

//Returns respone message
exports.stormMessageRecieved = (req) => {
	switch(req.type){
        case "throttle":
            return throttle;
            break;
        case "steering":
            return steering;
            break;
        case "brake":
            return brake;
        default:
            return 0;
    }
};
