summaryrefslogtreecommitdiff
path: root/src/simulation/tools/Cool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/tools/Cool.cpp')
-rw-r--r--src/simulation/tools/Cool.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/simulation/tools/Cool.cpp b/src/simulation/tools/Cool.cpp
new file mode 100644
index 0000000..b1b57b1
--- /dev/null
+++ b/src/simulation/tools/Cool.cpp
@@ -0,0 +1,23 @@
+#include "simulation/Tools.h"
+//#TPT-Directive ToolClass Tool_Cool TOOL_COOL 1
+Tool_Cool::Tool_Cool()
+{
+ Identifier = "DEFAULT_TOOL_COOL";
+ Name = "COOL";
+ Colour = PIXPACK(0x00DDFF);
+ Description = "Cools particles";
+}
+
+int Tool_Cool::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
+{
+ if(!cpart)
+ return 0;
+ cpart->temp -= strength;
+ if(cpart->temp > MAX_TEMP)
+ cpart->temp = MAX_TEMP;
+ if(cpart->temp < 0)
+ cpart->temp = 0;
+ return 1;
+}
+
+Tool_Cool::~Tool_Cool() {} \ No newline at end of file