Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated testing #1

Merged
merged 25 commits into from
Jul 7, 2017
Merged

Automated testing #1

merged 25 commits into from
Jul 7, 2017

Conversation

SirRamEsq
Copy link
Owner

The groundwork has been laid for the unit testing framework. Changes were made to how the engine is structured in order to run it against unit tests, however the engine still behaves as it did before the introduction of unit tests.

…ction, refactored GameStateManager::SetCurrentMap

ifdef mocksystem is inflexible, it cannot be used to decide dependencies at runtime, only compile time
BaseComponentManagers can now be passed any component and it will add it into the list of currently active components
	This will be useful for dependency injection as you pass mocks to the component managers now
SetCurrentMap was broken up into multiple funcitons to gain some coherency and reduce its CRAP index
- Refactored CompSprite slightly to no longer use const references to atomic types
- Checked for negative indicies in the "SpriteExists" function, allowing "Load Map from File" funcitonal test to pass

! For some reason, unit test cannot find needed textures to generate sprites from, will need to investigate
- Renamed LMap to RSC_Map
- Split interface and implentation into I_RSC_Map and RSC_MapImpl respectively
- Changes will enable injection of mock maps and generally cleaner design
- Planning to do the same with other resource classes
…abbing it from the Kernel

- No more assuming that the kernel->stateman has the dependency, needs to be set manually after instantiation
- Plan to do likewise with other cross component dependencies
…lly registered

- Decoupling Entity Manager and Kernel
- Components are ran in order specified
- Default oder exists inside entity manager as an enum
- Big commit incoming
- EventDispatchers and EntityMan is moved into GameState
- Input man is moved into GameStateManager
- GameStateManager sends KeyMapping structs into each GameState which is then injected into the Component Input Man
- The KeyMapping struct is a shared pointer between the InputManager, GameState, and ComInputMan
- EventMan, EntityMan, now have dependency injection methods
- EntityMan needs each componentManager to be specified and the order in wich they're run
- EventMan now has a "SetDependencies" method that needs called before use
- InputMan must now be used by passing the active state's event dispatcher along with (optionally) a keymapping struct
- Basic Test Added
- Basic Mocks for CPP and componentCollision in place
- Tile Layer Mock
- CPP Mock
- Collision Component Mock
@SirRamEsq SirRamEsq merged commit 4316f59 into master Jul 7, 2017
@SirRamEsq SirRamEsq deleted the automated-testing branch July 7, 2017 14:15
SirRamEsq added a commit that referenced this pull request Sep 20, 2017
-#1 Game would crash soon after loading map
	EntityManager::ClearALlEntities would be called setting
mFlagDeleteAll to true
	Cleanup would be called
	Because the map is currently empty, the flag would not be reset
	later the map would crash

-#2 Events for entiteis being deleted would be sent twice
	once from the EntityManager
	once from the ComponentManager
	now only sent from the EntityManager
@SirRamEsq SirRamEsq mentioned this pull request Dec 21, 2017
SirRamEsq added a commit that referenced this pull request Jan 29, 2018
SirRamEsq added a commit that referenced this pull request Jan 29, 2018
-#1 Game would crash soon after loading map
	EntityManager::ClearALlEntities would be called setting
mFlagDeleteAll to true
	Cleanup would be called
	Because the map is currently empty, the flag would not be reset
	later the map would crash

-#2 Events for entiteis being deleted would be sent twice
	once from the EntityManager
	once from the ComponentManager
	now only sent from the EntityManager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant