1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- //
- // main.cpp
- // auto_fill_jewel_v3
- //
- // Created by Red on 2024/11/22.
- //
- /*
- 需求:
- 1.给定宝石种类和每类数量
- 2.程序随机给出5种盘子组合
- 3.关卡由多个盘子组成,每个盘子包含若干不同层,每层上面包含宝石。
- 4.宝石有大、中、小三个尺度,按面积算: 1大=2中=4小
- 5.盘子有大、小、迷你3种,其容量分别对应 6个大宝石,3个大宝石,1个大宝石。(确认没有中盘子)
- 6.每个关卡最大有9个大盘子。
- 7.盘子之间的层数差异在0-1个。迷你盘子数量可以很多,这个是不是需要人工控制后面再问吧。
- 8.盘子会移动,但是盘子间不会重叠。
- 9.大中小号盘子有横的有竖着的。
- 10.重叠区百分比可以从0.05到0.2,程序自行判断最优值。
- 11.宝石只提供 80x80的资源,对应大。如果有中和小,需要程序缩放(0.75,0.50)。大、中、小是不同的宝石各消各的。
- */
- #include <iostream>
- #include <string>
- #include <vector>
- #include "SpriteData.hpp"
- #include "ajson5.hpp"
- #include "contourdata.h"
- #include "LevelGenerate.hpp"
- #include "FillGlobalConfig.hpp"
- #include "RandomGridFiller.hpp"
- #include "BoostGeometryTools.hpp"
- #include <opencv2/core.hpp>
- #include <opencv2/imgproc.hpp>
- #include <opencv2/highgui.hpp>
- #include <sstream>
- #include <ctime>
- #include <chrono>
- #include <tuple>
- #include <sstream>
- using namespace ArduinoJson;
- using namespace std;
- int main(int argc, const char * argv[]) {
- cout<<"A program to generate level. 2024-11-23"<<endl;
- cout<<"usage:auto_fill_jewel_v3"<<endl;
- cout<<"version v3.0"<<endl ;
-
- FillGlobalConfig::getInstance() ; //inited
-
- FillGlobalConfig::LevelData* level100_1 = FillGlobalConfig::getInstance()->getLevelData(100, 0) ;
- LevelGenerate genv3 ;
- genv3.generateAll(*level100_1, "sg_level_out_100-1.json") ;
-
- return 0;
- }
|