forked from conan513/mod-solocraft
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(SoloCraft): exclude map/instance from Solocraft scaling with conf (
#50) * Exclude map/instance from Solocraft scaling with conf * include cstdint
- Loading branch information
1 parent
2b8193e
commit a1902a8
Showing
5 changed files
with
79 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,8 @@ local.properties | |
.loadpath | ||
.project | ||
.cproject | ||
|
||
# | ||
# Visual Studio Code | ||
# | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "Utils.h" | ||
#include <iostream> | ||
#include <sstream> | ||
#include <string> | ||
#include <vector> | ||
|
||
std::vector<std::string> split(const std::string& str, char delimiter) { | ||
std::vector<std::string> res; | ||
if (str.empty()) return res; | ||
std::string token; | ||
std::istringstream tokenStream(str); | ||
while (std::getline(tokenStream, token, delimiter)) { | ||
res.push_back(token); | ||
} | ||
return res; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef UTILS_H | ||
#define UTILS_H | ||
|
||
#include <cstdint> | ||
#include <iostream> | ||
#include <vector> | ||
#include <string> | ||
#include <sstream> | ||
|
||
std::vector<std::string> split(const std::string& str, char delimiter); | ||
|
||
template <class T> | ||
void LoadList(const std::string& value, T& list) { | ||
std::vector<std::string> ids = split(value, ','); | ||
for (const std::string& id_str : ids) { | ||
uint32_t id = static_cast<uint32_t>(std::atoi(id_str.c_str())); | ||
list.push_back(id); | ||
} | ||
} | ||
|
||
#endif |