-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SRV] refact(atmos, world): overhaul atmos, make it world's subsystem
Base commit for new atmos locales logic, which supports z-levels, and produce more accurate locales. Also locale is mostly prepared for moving to separate thread. For this purpose subsystems are introduced. closes #15
- Loading branch information
Showing
34 changed files
with
598 additions
and
492 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,9 @@ | ||
#pragma once | ||
|
||
#include <chrono> | ||
|
||
#include <Shared/IFaces/IFace.h> | ||
|
||
struct ISubsystem : IFace { | ||
virtual void Update(std::chrono::microseconds timeElapsed) = 0; | ||
}; |
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,27 @@ | ||
#pragma once | ||
|
||
#include <chrono> | ||
#include <list> | ||
|
||
#include <Shared/IFaces/IFace.h> | ||
#include <Shared/Geometry/DirectionSet.h> | ||
|
||
class Object; | ||
class Map; | ||
|
||
struct ITile : public IFace { | ||
virtual void Update(std::chrono::microseconds timeElapsed) = 0; | ||
|
||
virtual bool MoveTo(Object *) = 0; | ||
virtual void PlaceTo(Object *) = 0; | ||
virtual bool RemoveObject(Object *obj) = 0; | ||
|
||
virtual const std::list<Object *> &Content() const = 0; | ||
|
||
virtual uf::vec3i GetPos() const = 0; | ||
virtual ITile *StepTo(uf::Direction direction) const = 0; | ||
virtual Map *GetMap() const = 0; | ||
|
||
virtual bool IsDense(uf::DirectionSet directions) const = 0; | ||
virtual Object *GetDenseObject(uf::DirectionSet directions) const = 0; | ||
}; |
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,22 @@ | ||
#pragma once | ||
|
||
#include <Shared/IFaces/IHasRepeatableID.h> | ||
#include <Shared/Geometry/DirectionSet.h> | ||
|
||
#include <World/ISubsystem.h> | ||
|
||
namespace subsystem { | ||
|
||
namespace atmos { | ||
|
||
struct ILocale : public IFace, public IHasRepeatableID { | ||
|
||
}; | ||
|
||
} // namespace atmos | ||
|
||
struct IAtmos : public ISubsystem { | ||
|
||
}; | ||
|
||
} // namespace subsystem |
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,20 @@ | ||
#pragma once | ||
|
||
#include <World/ITile.h> | ||
#include <World/Subsystems/IAtmos.h> | ||
|
||
namespace subsystem { | ||
namespace atmos { | ||
|
||
struct IAtmosTile : public ITile { | ||
virtual bool SynchronizeAtmos() = 0; | ||
|
||
virtual ILocale *GetLocale() = 0; | ||
virtual void SetLocale(ILocale *locale) = 0; | ||
|
||
virtual uf::DirectionSetFractional GetAirtightness() const = 0; | ||
virtual float GetAirtightnessTo(uf::Direction direction) const = 0; | ||
}; | ||
|
||
} // namespace atmos | ||
} // namespace subsystem |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.