about summary refs log tree commit diff stats
path: root/data/maps/the_tree/metadata.txtpb
blob: 6090384d261934e64d8ab737c1b0cbb50dc28d5e (plain) (blame)
1
display_name: "The Tree"
ighlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#ifndef AUTOMATABLE_H_3D519131
#define AUTOMATABLE_H_3D519131

#include "component.h"
#include <vector>
#include <random>

class AutomatableComponent : public Component {
public:

  /**
   * Helper class that defines an automatable action.
   */
  class Action {
  public:

    /**
     * The horizontal and vertical speed, in pixels/sec, that the entity should
     * move at.
     */
    double speedX;
    double speedY;

    /**
     * The duration of the action in seconds.
     */
    double dur;
  };

  /**
   * Helper type that defines a behavior that an entity can exhibit, which is a
   * list of actions that are stepped through in sequence.
   */
  using Behavior = std::vector<Action>;

  /**
   * A group of behaviors that the entity can exhibit, which are picked at
   * random at the start of automation and whenever a behavior completes.
   *
   * @managed_by RealizingSystem
   */
  std::vector<Behavior> behaviors;

  /**
   * A random distribution over the above behaviors.
   *
   * @managed_by RealizingSystem
   */
  std::discrete_distribution<size_t> behaviorDist;

  /**
   * A flag indicating whether a behavior is currently executing.
   *
   * @managed_by AutomatingSystem
   */
  bool behaviorRunning = false;

  /**
   * A flag indicating whether an action is currently executing.
   *
   * @managed_by AutomatingSystem
   */
  bool actionRunning = false;

  /**
   * The index of the currently executing behavior, if there is one.
   *
   * @managed_by AutomatingSystem
   */
  size_t currentBehavior;

  /**
   * The index of the currently executing action, if there is one.
   *
   * @managed_by AutomatingSystem
   */
  size_t currentAction;

  /**
   * The amount of time remaining, in seconds, of the currently executing
   * action.
   *
   * @managed_by AutomatingSystem
   */
  double remaining;

  /**
   * If this flag is disabled, the entity will be ignored by the automating
   * system.
   *
   * @managed_by RealizingSystem
   */
  bool active = false;
};

#endif /* end of include guard: AUTOMATABLE_H_3D519131 */