#ifndef BOARD_H #define BOARD_H #include "pixelGameEngine.h" class Block; class BlockClump; enum class BlockColor; class ColorDistributor{ std::array,10>rangeTable; int maxRange=0; std::uniform_int_distribution<>range; public: ColorDistributor(std::arraycolorRates){ int sum=0; for (int i=0;i0) { rangeTable[i]={sum,sum+colorRates[i]}; sum+=colorRates[i]; maxRange=sum; } else { rangeTable[i]={-1,-1}; } } range=std::uniform_int_distribution<>(0, maxRange); } BlockColor getRandomColor(); }; class Board{ std::vector> cols; std::vector clumps; public: ColorDistributor colorHandler; float yBottom; Decal*tileset; vf2d drawOffset; vi2d boardSize; float gravity; float maxGravity; float spawnRate; float launchSpd; Board(); Board(vi2d boardSize,float gravity,float maxGravity,float launchSpd,float spawnRate,std::array colorRates,Renderable&tileset); void spawnBlock(int col); std::vector&getBlocks(int col); std::vector&getBlockClumps(); void convertClump(int ind); void removeClump(int ind); }; #endif