Skip to content

Instantly share code, notes, and snippets.

View mdragon159's full-sized avatar

Jawad mdragon159

View GitHub Profile
@mdragon159
mdragon159 / SnapshotTests.h
Created January 7, 2022 21:11
EnTT Snapshot Creation & Restoration Unit Test
#include "pch.h" // #include <gtest/gtest.h>
#include "TestGameManager.h"
namespace SnapshotTests {
class SnapshotTests : public ::testing::Test {
protected:
entt::registry registry;
TestGameManager toTest;
@mdragon159
mdragon159 / Components.def
Last active January 3, 2022 01:20
Sample EnTT Snapshot Creation & Restoration
// Macro workaround to having to define code for every single component
// Just need to remember to define all Component classes here as well as in Components.h
// References:
// https://stackoverflow.com/questions/25428144/iterate-a-preprocessor-macro-on-a-list-of-class-names
// https://stackoverflow.com/questions/6635851/real-world-use-of-x-macros
// https://en.wikibooks.org/wiki/C_Programming/Preprocessor_directives_and_macros#X-Macros
// Also yes, file name + type is arbitrary
// Note that yes, macros should be a last resort. If there's a better way to arbitrarily define list of classes in one place
@mdragon159
mdragon159 / .vimrc
Created January 21, 2015 03:01
.vimrc Customization File
" Use pathogen to easily modify the runtime path to include all
" plugins under the ~/.vim/bundle directory
call pathogen#helptags()
call pathogen#infect()
" change the mapleader from \ to ,
let mapleader=","
" Quickly edit/reload the vimrc file
nmap <silent> <leader>ev :e $MYVIMRC<CR>