-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
252 additions
and
209 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
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 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 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 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 |
---|---|---|
|
@@ -71,7 +71,7 @@ def griddly_package_data(config='Debug'): | |
|
||
setup( | ||
name='griddly', | ||
version="1.2.17", | ||
version="1.2.18", | ||
author_email="[email protected]", | ||
description="Griddly Python Libraries", | ||
long_description=long_description, | ||
|
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,9 @@ | ||
#include "DelayedActionQueueItem.hpp" | ||
|
||
namespace griddly { | ||
|
||
DelayedActionQueueItem::DelayedActionQueueItem(uint32_t _playerId, uint32_t _priority, std::shared_ptr<Action> _action) | ||
: playerId(_playerId), priority(_priority), action(_action) { | ||
} | ||
|
||
} // namespace griddly |
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 |
---|---|---|
@@ -1,30 +1,27 @@ | ||
#pragma once | ||
#include <memory> | ||
|
||
#include "GDY/Actions/Action.hpp" | ||
#include <queue> | ||
#include "Util/util.hpp" | ||
|
||
namespace griddly { | ||
|
||
class Action; | ||
|
||
class DelayedActionQueueItem { | ||
public: | ||
DelayedActionQueueItem(uint32_t _playerId, uint32_t _priority, std::shared_ptr<Action> _action) | ||
: playerId(_playerId), priority(_priority), action(_action) { | ||
} | ||
bool operator==(const DelayedActionQueueItem& other) const { | ||
return priority == other.priority; | ||
} | ||
|
||
bool operator>(const DelayedActionQueueItem& other) const { | ||
return priority < other.priority; | ||
} | ||
|
||
bool operator<(const DelayedActionQueueItem& other) const { | ||
return priority > other.priority; | ||
} | ||
DelayedActionQueueItem(uint32_t _playerId, uint32_t _priority, std::shared_ptr<Action> _action); | ||
|
||
uint32_t playerId; | ||
uint32_t priority; | ||
std::shared_ptr<Action> action; | ||
}; | ||
|
||
struct SortDelayedActionQueue { | ||
bool operator()(std::shared_ptr<DelayedActionQueueItem> a, std::shared_ptr<DelayedActionQueueItem> b) { | ||
return a->priority > b->priority; | ||
}; | ||
}; | ||
|
||
typedef VectorPriorityQueue<std::shared_ptr<DelayedActionQueueItem>, std::vector<std::shared_ptr<DelayedActionQueueItem>>, SortDelayedActionQueue> DelayedActionQueue; | ||
|
||
} // namespace griddly |
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
Oops, something went wrong.