add config refactor structure
This commit is contained in:
34
src/entities/Fish.h
Normal file
34
src/entities/Fish.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
#include "../assets/FishAssets.h"
|
||||
#include "Entity.h"
|
||||
#include <array>
|
||||
#include <unordered_map>
|
||||
|
||||
class Fish : public Entity {
|
||||
private:
|
||||
static constexpr std::array<char, 12> AVAILABLE_COLORS = {
|
||||
'c', 'C', 'r', 'R', 'y', 'Y', 'b', 'B', 'g', 'G', 'm', 'M'};
|
||||
|
||||
const std::vector<std::string> ℑ
|
||||
std::vector<std::string> mask;
|
||||
const float speed;
|
||||
|
||||
static std::unordered_map<char, char> color_map;
|
||||
|
||||
explicit Fish(int asset_index);
|
||||
static int getRandomAssetIndex();
|
||||
void randomizeMask();
|
||||
|
||||
public:
|
||||
Fish();
|
||||
|
||||
void update() noexcept override;
|
||||
const std::vector<std::string> &getImage() const override { return image; }
|
||||
const std::vector<std::string> &getMask() const override { return mask; }
|
||||
char getDefaultColor() const noexcept override { return 'k'; }
|
||||
|
||||
std::unique_ptr<Entity> createReplacement() const override;
|
||||
int getPreferredLayer() const noexcept override;
|
||||
|
||||
bool shouldSpawnBubble() const;
|
||||
};
|
||||
Reference in New Issue
Block a user