This repository has been archived by the owner on Dec 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix glew link problem, prep CI stuff
- Loading branch information
1 parent
2cf4791
commit 944c7a0
Showing
8 changed files
with
97 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Test workflow | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
jobs: | ||
tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [macos-latest, windows-latest, ubuntu-latest] | ||
runs-on: ${{matrix.os}} | ||
steps: | ||
- uses: actions/checkout@main | ||
- uses: Run build | ||
run: | | ||
mkdir build && cd build | ||
cmake .. | ||
cmake --build . | ||
- uses: Run test | ||
run: | | ||
cd build | ||
cmake --build . --target test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "CreatureController.hpp" | ||
|
||
namespace genesis { | ||
// CreatureGroup {{{ | ||
CreatureGroup::CreatureGroup(const std::string& groupName, groupid_t groupId) : groupName(groupName), groupId(groupId) { | ||
|
||
} | ||
// }}} | ||
// CreatureController {{{ | ||
CreatureController::CreatureController() { | ||
|
||
} | ||
|
||
groupid_t CreatureController::provisionGroupId() { | ||
return CreatureController::CURR_RANDOM_GROUP_ID.fetch_add(1); | ||
} | ||
// }}} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
#include <mutex> | ||
#include <string> | ||
#include <vector> | ||
|
||
#include "genesis/core/game/ai/AIStructs.hpp" | ||
#include "genesis/rendering/Entity.hpp" | ||
|
||
namespace genesis { | ||
|
||
class CreatureGroup { | ||
private: | ||
// TODO: add entity IDs and convert to a map | ||
std::vector<std::shared_ptr<Entity>> entities; | ||
groupid_t groupId; | ||
public: | ||
const std::string groupName; | ||
|
||
CreatureGroup(const std::string& groupName, groupid_t groupId); | ||
}; | ||
|
||
/** | ||
* Contains and manages all the game's entities. AI control is distributed to | ||
* subcontrollers via this class. | ||
*/ | ||
class CreatureController { | ||
private: | ||
static std::atomic<groupid_t> CURR_RANDOM_GROUP_ID; | ||
std::map<groupid_t, CreatureGroup> groups; | ||
RelationMap creatureRelations; | ||
|
||
groupid_t provisionGroupId(); | ||
public: | ||
CreatureController(); | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters