33 lines
643 B
C++
33 lines
643 B
C++
#pragma once
|
|
#include "Entity.h"
|
|
#include "assets/FishAssets.h"
|
|
#include <array>
|
|
|
|
class Fish : public Entity {
|
|
private:
|
|
struct FishAssetRef {
|
|
int index;
|
|
FishAsset &asset;
|
|
};
|
|
|
|
Fish(const FishAssetRef &ref);
|
|
static bool initialized;
|
|
|
|
const std::vector<std::string> ℑ
|
|
std::vector<std::string> &mask;
|
|
|
|
static constexpr std::array<char, 12> availableColors = {
|
|
'c', 'C', 'r', 'R', 'y', 'Y', 'b', 'B', 'g', 'G', 'm', 'M'};
|
|
|
|
const float speed;
|
|
static FishAssetRef getRandomFishAsset();
|
|
|
|
static void initializeFishAssets();
|
|
void randomizeMask();
|
|
|
|
public:
|
|
Fish();
|
|
void update();
|
|
void draw(int layer);
|
|
};
|