]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/controller.cpp
Don't crash if a train has no router
[r2c2.git] / source / libr2c2 / controller.cpp
index 480abc2691ede5cc734e3cce301d04e2b3617563..ebec9903da0f450fd0ef4a91bfbc9ddecf2b7d0b 100644 (file)
@@ -1,16 +1,7 @@
-/* $Id$
-
-This file is part of R²C²
-Copyright © 2010  Mikkosoft Productions, Mikko Rasa
-Distributed under the GPL
-*/
-
 #include <cmath>
-#include <msp/core/except.h>
 #include "controller.h"
 
 using namespace std;
-using namespace Msp;
 
 namespace R2C2 {
 
@@ -44,7 +35,7 @@ Controller::Control Controller::Control::binary(const string &n)
 Controller::Control Controller::Control::discrete(const string &n, float m, float x, float s)
 {
        if(x<m)
-               throw InvalidParameterValue("Max value must be greater than min value");
+               throw invalid_argument("Controller::Control::discrete");
 
        Controller::Control tc;
        tc.name = n;
@@ -60,7 +51,7 @@ Controller::Control Controller::Control::discrete(const string &n, float m, floa
 Controller::Control Controller::Control::continuous(const string &n, float m, float x)
 {
        if(x<m)
-               throw InvalidParameterValue("Max value must be greater than min value");
+               throw invalid_argument("Controller::Control::continuous");
 
        Controller::Control tc;
        tc.name = n;