Skip to content
Snippets Groups Projects
Commit b8b5e5d9 authored by David Maul's avatar David Maul :crab:
Browse files

experimental changes for units and weapons

parent 560c410e
No related branches found
No related tags found
1 merge request!15Merge units into main
#pragma once
#include "engine.hpp"
#include "weapon.hpp"
#include <optional>
namespace advanced_wars {
......@@ -61,9 +63,24 @@ public:
private:
int x;
int y;
UnitFaction faction;
UnitId id;
UnitState state;
int health;
int range;
int fuel;
int max_fuel;
bool has_moved;
bool has_attacked;
// Primary weapon ammo
int ammo;
std::optional<Weapon> primary;
std::optional<Weapon> secondary;
};
} // namespace advanced_wars
\ No newline at end of file
#include "weapon.hpp"
namespace advanced_wars {}
\ No newline at end of file
#pragma once
#include "unit.hpp"
#include <unordered_map>
namespace advanced_wars {
// Forward Declaration
enum class UnitId;
class Weapon {
public:
// Ranges
int min_range;
int max_range;
// Damage
std::unordered_map<UnitId, int> damage;
};
} // namespace advanced_wars
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment