MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Element_ForkBomb2.h
Go to the documentation of this file.
1 /* -*- mode:C++ -*-
2  Element_ForkBomb2.h Light cone painting element
3  Copyright (C) 2014 The Regents of the University of New Mexico. All rights reserved.
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
27 #ifndef ELEMENT_FORKBOMB2_H
28 #define ELEMENT_FORKBOMB2_H
29 
30 #include "Element.h"
31 #include "EventWindow.h"
33 #include "ElementTable.h"
34 #include "itype.h"
35 
36 namespace MFM
37 {
38 
39 #define FORKBOMB2_VERSION 1
40 
41  template <class CC>
43  {
44  // Extract short names for parameter types
45  typedef typename CC::ATOM_TYPE T;
46  typedef typename CC::PARAM_CONFIG P;
47  enum { R = P::EVENT_WINDOW_RADIUS };
48 
49  private:
50 
51  ElementParameterS32<CC> m_bombRange;
52 
53  public:
54 
55  static Element_ForkBomb2 THE_INSTANCE;
56 
57  virtual u32 GetBombRange() const
58  {
59  return (u32) m_bombRange.GetValue();
60  }
61 
63  AbstractElement_ForkBomb<CC>(MFM_UUID_FOR("BombBlue", FORKBOMB2_VERSION)),
64  m_bombRange(this, "range", "Bomb Radius",
65  "Radius of copying during each bomb event",
66  0, 2, 4/*, 1*/)
67  {
69  Element<CC>::SetName("Blue Fork Bomb");
70  }
71 
72  virtual u32 LocalPhysicsColor(const T& atom, u32 selector) const
73  {
74  return 0xff0000aa;
75  }
76 
77  };
78 
79  template <class CC>
80  Element_ForkBomb2<CC> Element_ForkBomb2<CC>::THE_INSTANCE;
81 
82 }
83 
84 #endif /* ELEMENT_FORKBOMB2_H */
virtual u32 LocalPhysicsColor(const T &atom, u32 selector) const
Definition: Element_ForkBomb2.h:72
Definition: AbstractElement_ForkBomb.h:41
void SetName(const char *name)
Definition: Element.h:209
void SetAtomicSymbol(const char *symbol)
Definition: Element.h:193
Definition: Parameter.h:593
Definition: Element_ForkBomb2.h:42
virtual u32 GetBombRange() const
Definition: Element_ForkBomb2.h:57