| 398 | } |
| 399 | |
| 400 | float ScriptParam::GetFloat() const { |
| 401 | switch (type_) { |
| 402 | case FLOAT: |
| 403 | return f_val_; |
| 404 | case INT: |
| 405 | return (float)i_val_; |
| 406 | case STRING: |
| 407 | return (float)atof(str_val_.c_str()); |
| 408 | default: |
| 409 | DisplayError("Error", "Calling GetFloat() on parameter of invalid type."); |
| 410 | return -1.0f; |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | int ScriptParam::GetInt() const { |
| 415 | switch (type_) { |
no test coverage detected