diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..b0a5784 --- /dev/null +++ b/.clang-format @@ -0,0 +1,50 @@ +--- +BasedOnStyle: Microsoft +AlignAfterOpenBracket: Align +AlignConsecutiveMacros: 'true' +AlignConsecutiveAssignments: 'false' +AlignEscapedNewlines: Left +AlignOperands: 'true' +AlignTrailingComments: 'true' +AllowAllArgumentsOnNextLine: 'true' +AllowShortBlocksOnASingleLine: 'false' +AllowShortCaseLabelsOnASingleLine: 'true' +AllowShortIfStatementsOnASingleLine: Never +BinPackArguments: 'false' +BinPackParameters: 'false' +IncludeBlocks: Regroup +BraceWrapping: + AfterClass: true + AfterControlStatement: true + AfterEnum: true # <-- You need this + AfterFunction: true + AfterNamespace: true + AfterObjCDeclaration: true + AfterStruct: true + AfterUnion: true + AfterExternBlock: false # <-- And this + BeforeCatch: true + BeforeElse: true + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false +BreakBeforeBraces: Custom # <-- And this +BreakBeforeBinaryOperators: All +ColumnLimit: 0 +IndentCaseLabels: 'false' +Language: Cpp +MaxEmptyLinesToKeep: '1' +PointerAlignment: Left +ReflowComments: 'true' +SortIncludes: 'true' +SortUsingDeclarations: 'true' +SpaceAfterLogicalNot: 'false' +SpaceBeforeAssignmentOperators: 'true' +SpaceBeforeCpp11BracedList: 'true' +SpaceBeforeInheritanceColon: 'true' +TabWidth: '4' +UseTab: Never +AccessModifierOffset: '-4' + +... diff --git a/Game/ExampleGame.cpp b/Game/ExampleGame.cpp index 81ff27f..f49e943 100644 --- a/Game/ExampleGame.cpp +++ b/Game/ExampleGame.cpp @@ -1,137 +1,120 @@ -#include - #include #include -#include - #include +#include +#include -class BackgroundLevel : public Core::GameLayer { - +class BackgroundLevel : public Core::GameLayer +{ }; class Level : public Core::GameLayer { public: - Level() - { - Core::EventManager::GetInstance().DebugPrint(); - } + Level() + { + Core::EventManager::GetInstance().DebugPrint(); + } - void Attach() override - { + void Attach() override + { + } - } + void FrameTick() override + { + } - void FrameTick() override - { + void TimeTick() override + { + } + bool EventRecieved(Core::GenericEvent& e) override + { + return false; + } - - - } - - void TimeTick() override - { - - } - - bool EventRecieved( Core::GenericEvent& e ) override - { - return false; - } - - void Detach() override - { - - } + void Detach() override + { + } }; -class DebugLayer : public Core::GameLayer +class DebugLayer : public Core::GameLayer { public: - DebugLayer() - { - - } + DebugLayer() + { + } - void Attach() override - { + void Attach() override + { + } - } + void FrameTick() override + { - void FrameTick() override - { + ImGui::Begin("Debug"); - ImGui::Begin( "Debug" ); + ImGui::End(); + } - ImGui::End(); + void TimeTick() override + { + } - } + bool EventRecieved(Core::GenericEvent& e) override + { + return false; + } - void TimeTick() override - { - - } - - bool EventRecieved( Core::GenericEvent& e ) override - { - return false; - } - - void Detach() override - { - - } + void Detach() override + { + } }; class ExampleGame : public Core::App { public: - ExampleGame() - : App( { "Example" }, { "Game with AEON!" } ) - { + ExampleGame() + : App({"Example"}, {"Game with AEON!"}) + { + // EC::EntityRegistry registry; + // + // EC::Entity entity1 = registry.Create(); + // + // std::cout << "1: " << entity1 << std::endl; + // + // std::vector entities; + // + // for (int i = 0; i < 100; i++) + // { + // entities.push_back(registry.Create()); + // } + // + // std::cout << entities[entities.size()] << std::endl; + // + // for (int i = 0; i < 100; i++) + // { + // std::cout << "ENtity in vector pos " << i << " " << entities[i] << std::endl; + // registry.Destroy(entities[i]); + // } + // + // EC::Entity entity2 = registry.Create(); + // std::cout << "2: " << entity2 << std::endl; - EC::EntityRegistry registry; - - EC::Entity entity1 = registry.Create(); - - std::cout << "1: " << entity1 << std::endl; - - std::vector entities; - - for (int i = 0; i < 100; i++) - { - entities.push_back(registry.Create()); - } - - std::cout << entities[entities.size()] << std::endl; - - for (int i = 0; i < 100; i++) - { - std::cout << "ENtity in vector pos " << i << " " << entities[i] << std::endl; - registry.Destroy(entities[i]); - } - - EC::Entity entity2 = registry.Create(); - std::cout << "2: " << entity2 << std::endl; - - Level* level = new Level; - PushLayer( (Core::GameLayer*)level ); - DebugLayer* debug = new DebugLayer; - PushDebugLayer( debug ); - Run(); - delete level; - } - - ~ExampleGame() - { - - } + Level* level = new Level; + PushLayer((Core::GameLayer*)level); + DebugLayer* debug = new DebugLayer; + PushDebugLayer(debug); + Run(); + delete level; + } + ~ExampleGame() + { + } }; -int main( int argc, char** argv ) +int main(int argc, char** argv) { ExampleGame game;