summary refs log tree commit diff stats
path: root/.gitattributes
blob: 3dd6c7da9100b6bf7bec6022fd20a6341fc5c2f1 (plain) (blame)
1
2
3
4
# Auto detect text files and perform LF normalization
* text=auto
*.cpp text eol=crlf
*.h text eol=crlf
00 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .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 TANGIBLE_H_746DB3EE
#define TANGIBLE_H_746DB3EE

#include <set>
#include "component.h"
#include "entity_manager.h"
#include "vector.h"
#include "direction.h"

class PonderableComponent : public Component {
public:

  using id_type = EntityManager::id_type;

  /**
   * List of different types of physical bodies.
   *
   * vacuumed     - Default.
   * freefalling  - The body will be treated as if there were a downward force
   *                of gravity being exerted onto it. The body will also exhibit
   *                terminal velocity (that is, its downward velocity will be
   *                capped at a constant value).
   */
  enum class Type {
    vacuumed,
    freefalling
  };

  /**
   * List of different types of collidable surfaces.
   */
  enum class Collision {
    wall,
    platform,
    adjacency,
    warp,
    danger,
    event
  };

  /**
   * Constructor for initializing the body type, which is a constant.
   */
  PonderableComponent(Type type) : type(type)
  {
  }

  /**
   * The velocity of the body.
   */
  vec2d vel = { 0.0, 0.0 };

  /**
   * The acceleration of the body.
   */
  vec2d accel = { 0.0, 0.0 };

  /**
   * The target velocity of the body.
   */
  vec2d targetVel = { 0.0, 0.0 };

  /**
   * The type of physical body that the entity is meant to assume. The body will
   * be acted upon differently based on this. See the enumeration above for more
   * details.
   *
   * @managed_by PonderingSystem
   */
  const Type type;

  /**
   * Whether or not a freefalling body is in contact with the ground.
   *
   * @managed_by PonderingSystem
   */
  bool grounded = false;

  /**
   * Whether or not a freefalling body is being ferried by another body.
   *
   * @managed_by PonderingSystem
   */
  bool ferried = false;

  /**
   * The entity that is ferrying this body, if there is one.
   *
   * @managed_by PonderingSystem
   */
  id_type ferry;

  /**
   * The side of the ferry that the body is resting on, if there is one.
   *
   * @managed_by PonderingSystem
   */
  Direction ferrySide;

  /**
   * The bodies that are being ferried by this body.
   *
   * @managed_by PonderingSystem
   */
  std::set<id_type> passengers;

  /**
   * If enabled, this will prevent the body from moving and accelerating. The
   * velocity and position of the body can still be affected by sources external
   * to the PonderingSystem. Enabling this will cause applicable bodies to
   * become ungrounded and unferried.
   */
  bool frozen = false;

  /**
   * If disabled, collision detection for this body will not be performed and
   * other bodies will ignore it. Disabling this will cause applicable bodies to
   * become ungrounded and unferried.
   */
  bool collidable = true;

  /**
   * The effect that colliding with this body has.
   */
  Collision colliderType = Collision::wall;

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

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