-
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.
- Loading branch information
Showing
32 changed files
with
386 additions
and
17 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef PRACTICALTOOLSFORSIMPLEDESIGN_STRUCTURE_BARRACKS_HPP | ||
#define PRACTICALTOOLSFORSIMPLEDESIGN_STRUCTURE_BARRACKS_HPP | ||
|
||
#include "Structure\IWayPointStructure.hpp" | ||
#include "Structure.hpp" | ||
#define DEFAULT_POWER -20.F | ||
#define DEFAULT_TIME 15.F | ||
#define DEFAULT_COST 300.F | ||
#define DEFAULT_HP 800.F | ||
|
||
class Barracks : public Structure,public IWayPointStructure{ | ||
public: | ||
Barracks(float electricPower=DEFAULT_POWER,float buildingTime=DEFAULT_POWER, | ||
float buildingCost=DEFAULT_POWER,float buildingHp=DEFAULT_POWER): Structure(electricPower, buildingTime, buildingCost, buildingHp){}; | ||
virtual glm::vec2 GetStructureLocation()override{return this->GetObjectLocation();}; | ||
void Start() override{this->SetWayPointLocation({this->GetObjectLocation().x+20,this->GetObjectLocation().y+20});}; | ||
}; | ||
|
||
#endif // PRACTICALTOOLSFORSIMPLEDESIGN_CAPYBARA_HPP |
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,12 @@ | ||
#include "Structure.hpp" | ||
|
||
#define DEFAULT_POWER 100.F | ||
#define DEFAULT_TIME 100.F | ||
#define DEFAULT_COST 100.F | ||
#define DEFAULT_HP 1000.F | ||
|
||
class Building:public Structure{ | ||
public: | ||
Building(float electricPower=DEFAULT_POWER,float buildingTime=DEFAULT_TIME, | ||
float buildingCost=DEFAULT_COST,float buildingHp=DEFAULT_HP): Structure(electricPower, buildingTime, buildingCost, buildingHp){}; | ||
}; |
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 @@ | ||
// | ||
// Created by nudle on 2024/3/3. | ||
// | ||
|
||
#ifndef PRACTICALTOOLSFORSIMPLEDESIGN_IWAYPOINTSTRUCTURE_HPP | ||
#define PRACTICALTOOLSFORSIMPLEDESIGN_IWAYPOINTSTRUCTURE_HPP | ||
#include "Structure.hpp" | ||
#include "Line.hpp" | ||
|
||
class IWayPointStructure{ | ||
private: | ||
glm::vec2 waypointLocation; | ||
public: | ||
virtual glm::vec2 GetWayPointLocation(){return this->waypointLocation;}; | ||
void SetWayPointLocation(glm::vec2 newLocation){ | ||
this->waypointLocation=newLocation; | ||
}; | ||
virtual glm::vec2 GetStructureLocation()=0; | ||
}; | ||
|
||
|
||
#endif // PRACTICALTOOLSFORSIMPLEDESIGN_IWAYPOINTSTRUCTURE_HPP |
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 @@ | ||
#ifndef PRACTICALTOOLSFORSIMPLEDESIGN_STRUCTURE_OreRefinery_HPP | ||
#define PRACTICALTOOLSFORSIMPLEDESIGN_STRUCTURE_OreRefinery_HPP | ||
|
||
#include "IWayPointStructure.hpp" | ||
#include "Structure.hpp" | ||
#define DEFAULT_POWER -30.F | ||
#define DEFAULT_TIME 100.F | ||
#define DEFAULT_COST 2000.F | ||
#define DEFAULT_HP 900.F | ||
|
||
class OreRefinery:public Structure,public IWayPointStructure{ | ||
public: | ||
OreRefinery(float electricPower=DEFAULT_POWER,float buildingTime=DEFAULT_TIME, | ||
float buildingCost=DEFAULT_COST,float buildingHp=DEFAULT_HP): Structure(electricPower, buildingTime, buildingCost, buildingHp){}; | ||
virtual glm::vec2 GetStructureLocation()override{return this->GetObjectLocation();}; | ||
void Start() override{this->SetWayPointLocation({this->GetObjectLocation().x+20,this->GetObjectLocation().y+20});}; | ||
}; | ||
#endif |
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,17 @@ | ||
#ifndef PRACTICALTOOLSFORSIMPLEDESIGN_STRUCTURE_PowerPlants_HPP | ||
#define PRACTICALTOOLSFORSIMPLEDESIGN_STRUCTURE_PowerPlants_HPP | ||
|
||
|
||
#include "Structure.hpp" | ||
#define DEFAULT_POWER 100.F | ||
#define DEFAULT_TIME 15.F | ||
#define DEFAULT_COST 300.F | ||
#define DEFAULT_HP 400.F | ||
|
||
class PowerPlants:public Structure{ | ||
public: | ||
PowerPlants(float electricPower=DEFAULT_POWER,float buildingTime=DEFAULT_TIME, | ||
float buildingCost=DEFAULT_COST,float buildingHp=DEFAULT_HP): Structure(electricPower, buildingTime, buildingCost, buildingHp){}; | ||
}; | ||
|
||
#endif |
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,19 @@ | ||
#ifndef PRACTICALTOOLSFORSIMPLEDESIGN_STRUCTURE_WarFactory_HPP | ||
#define PRACTICALTOOLSFORSIMPLEDESIGN_STRUCTURE_WarFactory_HPP | ||
|
||
#include "IWayPointStructure.hpp" | ||
#include "Structure.hpp" | ||
#define DEFAULT_POWER -30.F | ||
#define DEFAULT_TIME 100.F | ||
#define DEFAULT_COST 2000.F | ||
#define DEFAULT_HP 1000.F | ||
|
||
class WarFactory : public Structure,public IWayPointStructure{ | ||
public: | ||
WarFactory(float electricPower=DEFAULT_POWER,float buildingTime=DEFAULT_POWER, | ||
float buildingCost=DEFAULT_POWER,float buildingHp=DEFAULT_POWER): Structure(electricPower, buildingTime, buildingCost, buildingHp){}; | ||
virtual glm::vec2 GetStructureLocation()override{return this->GetObjectLocation();}; | ||
void Start() override{this->SetWayPointLocation({this->GetObjectLocation().x+20,this->GetObjectLocation().y+20});}; | ||
}; | ||
|
||
#endif // PRACTICALTOOLSFORSIMPLEDESIGN_CAPYBARA_HPP |
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 @@ | ||
// | ||
// Created by nudle on 2024/3/3. | ||
// | ||
|
||
#ifndef PRACTICALTOOLSFORSIMPLEDESIGN_WAYPOINT_HPP | ||
#define PRACTICALTOOLSFORSIMPLEDESIGN_WAYPOINT_HPP | ||
#include "Util/GameObject.hpp" | ||
#include "Util/TransformUtils.hpp" | ||
#include "Util/Image.hpp" | ||
|
||
class WayPoint : public Util::GameObject{ | ||
private: | ||
glm::vec2 ObjectLocation; | ||
public: | ||
WayPoint():Util::GameObject(){m_Transform.scale={0.2,0.2};}; | ||
void Update(const Util::Transform &transform = Util::Transform()) override; | ||
|
||
void Start() override{/*SetDrawable(std::make_unique<Util::Image>("../assets/sprites/flag.png"));*/}; | ||
void SetObjectLocation(glm::vec2 location) ; | ||
glm::vec2 GetObjectLocation(){return this->ObjectLocation; } | ||
}; | ||
#endif // PRACTICALTOOLSFORSIMPLEDESIGN_WAYPOINT_HPP |
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,21 @@ | ||
// | ||
// Created by nudle on 2024/3/5. | ||
// | ||
|
||
#ifndef PRACTICALTOOLSFORSIMPLEDESIGN_WAYPOINTTOOL_H | ||
#define PRACTICALTOOLSFORSIMPLEDESIGN_WAYPOINTTOOL_H | ||
|
||
#include <vector> | ||
#include "glm/glm.hpp" | ||
#include "Util/Input.hpp" | ||
#include "Structure/IWayPointStructure.hpp" | ||
class WayPointTool{ | ||
private: | ||
public: | ||
WayPointTool(){}; | ||
~WayPointTool(){}; | ||
|
||
bool checkMous(glm::vec2 objPos,glm::vec2 mousPos); | ||
}; | ||
|
||
#endif // PRACTICALTOOLSFORSIMPLEDESIGN_WAYPOINTTOOL_H |
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
Oops, something went wrong.