refactor fish
This commit is contained in:
17
src/Fish.h
17
src/Fish.h
@@ -1,31 +1,26 @@
|
||||
#pragma once
|
||||
#include "Entity.h"
|
||||
#include "assets/FishAssets.h"
|
||||
#include <array>
|
||||
|
||||
class Fish : public Entity {
|
||||
private:
|
||||
struct FishAssetPair {
|
||||
struct FishAssetRef {
|
||||
int index;
|
||||
const std::vector<std::string> *image;
|
||||
const std::vector<std::string> *mask;
|
||||
FishAsset &asset;
|
||||
};
|
||||
|
||||
Fish(const FishAssetPair &pair);
|
||||
|
||||
static std::vector<
|
||||
std::pair<std::vector<std::string>, std::vector<std::string>>>
|
||||
fishPairs;
|
||||
Fish(const FishAssetRef &ref);
|
||||
static bool initialized;
|
||||
|
||||
const std::vector<std::string> ℑ
|
||||
const std::vector<std::string> &refMask;
|
||||
std::vector<std::string> mask;
|
||||
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 FishAssetPair getRandomFishPair();
|
||||
static FishAssetRef getRandomFishAsset();
|
||||
|
||||
static void initializeFishAssets();
|
||||
void randomizeMask();
|
||||
|
||||
Reference in New Issue
Block a user