Skip to content

Commit

Permalink
Small bug fix. Still need to fix why dynamic cast assert is failing.
Browse files Browse the repository at this point in the history
  • Loading branch information
carrgran committed Oct 11, 2023
1 parent 29c3dea commit 7fa42e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/core/WorldBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ namespace cse491 {
/// @return A reference to the newly created entity
template <typename... PROPERTY_Ts>
Entity & AddEntity(std::string entity_name="None", PROPERTY_Ts... properties) {
auto entity_ptr = std::make_unique<Entity>(agent_set.size(), entity_name);
auto entity_ptr = std::make_unique<Entity>(item_set.size(), entity_name);
entity_ptr->SetProperties(std::forward<PROPERTY_Ts>(properties)...);
item_set.emplace_back(std::move(entity_ptr));
return *item_set.back();
Expand Down
6 changes: 3 additions & 3 deletions source/team8_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
int main()
{
cse491_team8::ManualWorld world;
world.AddEntity("Axe", "Cut", 5, "char", 'P').SetPosition(37, 3);
world.AddEntity("Boat", "Swim", 7, "char", 'U').SetPosition(18, 4);
world.AddAgent<cse491::TrashInterface>("Interface", "Strength", 7, "Health", 20, "Max_Health", 40, "Direction", 0).SetProperty("char", '@').SetPosition(40,3);
world.AddEntity("Axe", "Cut", 5).SetPosition(37, 3);
world.AddEntity("Boat", "Swim", 7).SetPosition(18, 4);
world.AddAgent<cse491::TrashInterface>("Interface", "Strength", 7, "Health", 20, "Max_Health", 40, "Direction", 0).SetProperty("symbol", '@').SetPosition(40,3);
world.AddAgent<cse491::PacingAgent>("Pacer 1", "Strength", 5, "Health", 5, "Max_Health", 30, "Direction", 0).SetPosition(45, 3);
world.AddAgent<cse491::PacingAgent>("Pacer 1", "Strength", 2, "Health", 10, "Max_Health", 30, "Direction", 0).SetPosition(3,14);
world.AddAgent<cse491::PacingAgent>("Pacer 2", "Strength", 4, "Health", 20, "Max_Health", 30, "Direction", 0).SetPosition(7,3);
Expand Down

0 comments on commit 7fa42e7

Please sign in to comment.