MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Element_CheckerForkBlue.h
Go to the documentation of this file.
1 /* -*- mode:C++ -*-
2  Element_CheckerForkBlue.h Basic Element exhibiting a circular dependency
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_CHECKERFORKBLUE_H
28 #define ELEMENT_CHECKERFORKBLUE_H
29 
30 #include "Element.h"
31 #include "EventWindow.h"
32 #include "ElementTable.h"
33 #include "itype.h"
34 
35 namespace MFM
36 {
37 
38  #define CHECKERFORK_VERSION 1
39 
40  template <class CC>
41  class Element_CheckerForkBlue : public Element<CC>
42  {
43  // Extract short names for parameter types
44  typedef typename CC::ATOM_TYPE T;
45  typedef typename CC::PARAM_CONFIG P;
46  enum { R = P::EVENT_WINDOW_RADIUS };
47 
48  public:
49 
50  static Element_CheckerForkBlue<CC> THE_INSTANCE;
51 
53  : Element<CC>(MFM_UUID_FOR("CheckerForkBlue", CHECKERFORK_VERSION))
54  {
56  Element<CC>::SetName("CheckerForkBlue");
57  }
58 
59  virtual u32 PercentMovable(const T& you,
60  const T& me, const SPoint& offset) const
61  {
62  return 100;
63  }
64 
65  virtual u32 DefaultPhysicsColor() const
66  {
67  return 0xff800080;
68  }
69 
70  virtual u32 DefaultLowlightColor() const
71  {
72  return 0xff400040;
73  }
74 
75  virtual const char* GetDescription() const
76  {
77  return "Blue Circular Dependency tutorial Element";
78  }
79 
80  virtual void Behavior(EventWindow<CC>& window) const;
81  };
82 
83  template <class CC>
84  Element_CheckerForkBlue<CC> Element_CheckerForkBlue<CC>::THE_INSTANCE;
85 }
86 
87 #include "Element_CheckerForkBlue.tcc"
88 
89 #endif /* ELEMENT_CHECKERFORKBLUE_H */
void SetName(const char *name)
Definition: Element.h:209
void SetAtomicSymbol(const char *symbol)
Definition: Element.h:193
virtual u32 DefaultLowlightColor() const
Definition: Element_CheckerForkBlue.h:70
virtual u32 PercentMovable(const T &you, const T &me, const SPoint &offset) const
Definition: Element_CheckerForkBlue.h:59
virtual const char * GetDescription() const
Definition: Element_CheckerForkBlue.h:75
Definition: Element_CheckerForkBlue.h:41
Definition: ElementTable.h:43
virtual u32 DefaultPhysicsColor() const
Definition: Element_CheckerForkBlue.h:65
virtual void Behavior(EventWindow< CC > &window) const
Definition: Element_CheckerForkBlue.tcc:7
Definition: Atom.h:43