Advertisement
boxmein

Copying an Existing Element

Oct 12th, 2013
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.63 KB | None | 0 0
  1. // This is an example of an element that has been copied from the source.
  2. // All required changes to make the element unique have been highlighted.
  3. // Run generator.py after adding this. You may change it later without re-generating.
  4.  
  5. #include "simulation/Elements.h"
  6. // you need to manually set the element ID for generator.py as well as the class name
  7.  //#TPT-Directive ElementClass Element_BCOL2 PT_BCOL2 177
  8.  Element_BCOL2::Element_BCOL2() // make sure the names here match the class definition
  9. {
  10.     Identifier = "DEFAULT_PT_BCOL2"; // Lua will crash on running if you make identifiers non-unique
  11.     Name = "BCO2"; // ???? will happen when names collide
  12.     Colour = PIXPACK(0x333333);
  13.     MenuVisible = 1;
  14.     MenuSection = SC_POWDERS;
  15.     Enabled = 1;
  16.    
  17.     Advection = 0.4f;
  18.     AirDrag = 0.04f * CFDS;
  19.     AirLoss = 0.94f;
  20.     Loss = 0.95f;
  21.     Collision = -0.1f;
  22.     Gravity = 0.3f;
  23.     Diffusion = 0.00f;
  24.     HotAir = 0.000f * CFDS;
  25.     Falldown = 1;
  26.    
  27.     Flammable = 0;
  28.     Explosive = 0;
  29.     Meltable = 0;
  30.     Hardness = 2;
  31.    
  32.     Weight = 90;
  33.    
  34.     Temperature = R_TEMP+0.0f   +273.15f;
  35.     HeatConduct = 150;
  36.     Description = "Broken Coal 2. Heavy particles, burns slowly.";
  37.    
  38.     State = ST_SOLID;
  39.     Properties = TYPE_PART;
  40.    
  41.     LowPressure = IPL;
  42.     LowPressureTransition = NT;
  43.     HighPressure = IPH;
  44.     HighPressureTransition = NT;
  45.     LowTemperature = ITL;
  46.     LowTemperatureTransition = NT;
  47.     HighTemperature = ITH;
  48.     HighTemperatureTransition = NT;
  49.    
  50.     Update = &Element_BCOL2::Update; // add an update function pointer
  51.     Graphics = NULL; // no graphics function - null pointer
  52. }
  53.  
  54.  Element_BCOL2::Update(UPDATE_FUNC_ARGS) {}
  55.  Element_BCOL2::~Element_BCOL2() {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement