<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.9.7" xml:lang="en-US">
  <compounddef id="d3/d17/ControllerComponent_8cpp" kind="file" language="C++">
    <compoundname>ControllerComponent.cpp</compoundname>
    <includes refid="d0/d32/ControllerComponent_8hpp" local="yes">ControllerComponent.hpp</includes>
    <includes local="no">string</includes>
    <incdepgraph>
      <node id="7">
        <label>Component.hpp</label>
        <link refid="df/d1f/Component_8hpp_source"/>
        <childnode refid="8" relation="include">
        </childnode>
        <childnode refid="9" relation="include">
        </childnode>
        <childnode refid="10" relation="include">
        </childnode>
        <childnode refid="11" relation="include">
        </childnode>
        <childnode refid="12" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
        <childnode refid="14" relation="include">
        </childnode>
      </node>
      <node id="2">
        <label>ControllerComponent.hpp</label>
        <link refid="d0/d32/ControllerComponent_8hpp_source"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
      </node>
      <node id="3">
        <label>TinyMath.hpp</label>
        <link refid="d9/dec/TinyMath_8hpp_source"/>
        <childnode refid="4" relation="include">
        </childnode>
        <childnode refid="5" relation="include">
        </childnode>
      </node>
      <node id="6">
        <label>TransformComponent.hpp</label>
        <link refid="d9/da8/TransformComponent_8hpp_source"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="7" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
      </node>
      <node id="1">
        <label>src/ControllerComponent.cpp</label>
        <link refid="d3/d17/ControllerComponent_8cpp"/>
        <childnode refid="2" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
      </node>
      <node id="8">
        <label>SDL.h</label>
      </node>
      <node id="14">
        <label>algorithm</label>
      </node>
      <node id="4">
        <label>cmath</label>
      </node>
      <node id="9">
        <label>imgui.h</label>
      </node>
      <node id="10">
        <label>imgui_impl_sdl2.h</label>
      </node>
      <node id="11">
        <label>imgui_impl_sdlrenderer.h</label>
      </node>
      <node id="5">
        <label>ostream</label>
      </node>
      <node id="13">
        <label>string</label>
      </node>
      <node id="12">
        <label>vector</label>
      </node>
    </incdepgraph>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&quot;ControllerComponent.hpp&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;string&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight></codeline>
<codeline lineno="4" refid="d1/ddc/classControllerComponent_1a9e9959a30979e957650daeb80bcdfbdf" refkind="member"><highlight class="normal"><ref refid="d1/ddc/classControllerComponent_1a9e9959a30979e957650daeb80bcdfbdf" kindref="member">ControllerComponent::ControllerComponent</ref>(<ref refid="d2/d0a/classTransformComponent" kindref="compound">TransformComponent</ref><sp/>*_transform,<sp/><ref refid="dd/d40/structVec2D" kindref="compound">Vec2D</ref><sp/>_deltaPos)<sp/>{</highlight></codeline>
<codeline lineno="5"><highlight class="normal"><sp/><sp/><sp/><sp/>transform<sp/>=<sp/>_transform;</highlight></codeline>
<codeline lineno="6"><highlight class="normal"><sp/><sp/><sp/><sp/>deltaPos<sp/>=<sp/>_deltaPos;</highlight></codeline>
<codeline lineno="7"><highlight class="normal">}</highlight></codeline>
<codeline lineno="8"><highlight class="normal"></highlight></codeline>
<codeline lineno="9" refid="d1/ddc/classControllerComponent_1a2a874e5d561bdc75d5f8e75603135b0f" refkind="member"><highlight class="normal"><ref refid="d1/ddc/classControllerComponent_1a2a874e5d561bdc75d5f8e75603135b0f" kindref="member">ControllerComponent::~ControllerComponent</ref>()<sp/>{</highlight></codeline>
<codeline lineno="10"><highlight class="normal">}</highlight></codeline>
<codeline lineno="11"><highlight class="normal"></highlight></codeline>
<codeline lineno="12" refid="d1/ddc/classControllerComponent_1a15980f62cf3400a2829e78d6e0073ea1" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="d1/ddc/classControllerComponent_1a15980f62cf3400a2829e78d6e0073ea1" kindref="member">ControllerComponent::Update</ref>(SDL_Event<sp/>e,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>frame,<sp/>std::vector&lt;std::string&gt;<sp/>broadcastList)<sp/>{</highlight></codeline>
<codeline lineno="13"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="d8/d6b/classComponent_1aea8f0f460a62d86183020bd667b6cbf0" kindref="member">ParseAndUpdateBroadcast</ref>(broadcastList);</highlight></codeline>
<codeline lineno="14"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>Uint8<sp/>*currentKeyStates<sp/>=<sp/>SDL_GetKeyboardState(NULL);</highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="dd/d40/structVec2D" kindref="compound">Vec2D</ref><sp/>pos<sp/>=<sp/>transform-&gt;<ref refid="d2/d0a/classTransformComponent_1a5452c308a26521441745d3edc1ab5d4d" kindref="member">getPos</ref>();</highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(currentKeyStates[SDL_SCANCODE_LEFT]<sp/>||<sp/>currentKeyStates[SDL_SCANCODE_A])<sp/>{</highlight></codeline>
<codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;Left<sp/>\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="20"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>transform-&gt;<ref refid="d2/d0a/classTransformComponent_1aa3cd2785878a82d02103778d04761a32" kindref="member">SetTransform</ref>(pos.x<sp/>-<sp/>deltaPos.x,<sp/>pos.y);</highlight></codeline>
<codeline lineno="21"><highlight class="normal"><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(currentKeyStates[SDL_SCANCODE_RIGHT]<sp/>||<sp/>currentKeyStates[SDL_SCANCODE_D])<sp/>{</highlight></codeline>
<codeline lineno="22"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>printf(</highlight><highlight class="stringliteral">&quot;Right<sp/>\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="23"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>transform-&gt;<ref refid="d2/d0a/classTransformComponent_1aa3cd2785878a82d02103778d04761a32" kindref="member">SetTransform</ref>(pos.x<sp/>+<sp/>deltaPos.x,<sp/>pos.y);</highlight></codeline>
<codeline lineno="24"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="25"><highlight class="normal">}</highlight></codeline>
<codeline lineno="26"><highlight class="normal"></highlight></codeline>
<codeline lineno="27" refid="d1/ddc/classControllerComponent_1ac55c98ab7c759f014314998b9db372a4" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="d1/ddc/classControllerComponent_1ac55c98ab7c759f014314998b9db372a4" kindref="member">ControllerComponent::ShowComponentEditor</ref>(</highlight><highlight class="keywordtype">bool</highlight><highlight class="normal">*<sp/>showEditor){</highlight></codeline>
<codeline lineno="28"><highlight class="normal"><sp/><sp/><sp/><sp/>ImGuiWindowFlags<sp/>window_flags<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="29"><highlight class="normal"><sp/><sp/><sp/><sp/>window_flags<sp/>|=<sp/>ImGuiWindowFlags_MenuBar;</highlight></codeline>
<codeline lineno="30"><highlight class="normal"><sp/><sp/><sp/><sp/>window_flags<sp/>|=<sp/>ImGuiWindowFlags_NoCollapse;</highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(ImGui::Begin(</highlight><highlight class="stringliteral">&quot;Editing<sp/>Controller<sp/>Component&quot;</highlight><highlight class="normal">,<sp/>showEditor,<sp/>window_flags)){</highlight></codeline>
<codeline lineno="33"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ImGui::Text(</highlight><highlight class="stringliteral">&quot;Nothing<sp/>to<sp/>edit&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="34"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ImGui::End();</highlight></codeline>
<codeline lineno="35"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="36"><highlight class="normal">}</highlight></codeline>
    </programlisting>
    <location file="src/ControllerComponent.cpp"/>
  </compounddef>
</doxygen>
