blob: 6bf8ce65f9c0409093c89a4e64d6e3fe2438dcb4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
#include <string>
#include "Console.h"
int Console::ParseType(std::string * type)
{
char * txt = (char *)type->c_str();
int i = -1;
// alternative names for some elements
if (*type == "C4") i = PT_PLEX;
else if (*type == "C5") i = PT_C5;
else if (*type == "NONE") i = PT_NONE;
if (i>=0 && i<PT_NUM && sim->ptypes[i].enabled)
{
(*lastError) = "";
return i;
}
for (i=1; i<PT_NUM; i++) {
if (strcasecmp(txt, sim->ptypes[i].name)==0 && sim->ptypes[i].enabled)
{
(*lastError) = "";
return i;
}
}
(*lastError) = "Particle type not recognised";
return -1;
}
void Console::Tick(float * dt)
{
}
void Console::ConsoleShown()
{
}
void Console::ConsoleHidden()
{
}
int Console::ProcessCommand(std::string * command)
{
}
std::string * Console::GetLastError()
{
return lastError;
}
std::vector<ConsoleCommand> * Console::GetPreviousCommands()
{
}
Console::Console(ui::Sandbox * sandbox)
{
this->sandbox = sandbox;
sim = sandbox->GetSimulation();
}
Console::~Console()
{
}
|