1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-22 23:17:04 +00:00

replacing with an explicit list

This commit is contained in:
Zeno Rogue 2018-06-17 18:32:06 +02:00
parent dabf322095
commit d3200253db
5 changed files with 40 additions and 14 deletions

View File

@ -144,7 +144,7 @@ cellwalker cwt; // single player character position
inline cell*& singlepos() { return cwt.c; }
inline bool singleused() { return !(shmup::on || multi::players > 1); }
mt19937 r;
std::mt19937 r;
void shrand(int i) {
r.seed(i);
@ -161,7 +161,7 @@ ld hrandf() {
}
int hrandstate() {
mt19937 r2 = r;
std::mt19937 r2 = r;
return r2() & HRANDMAX;
}

31
hyper.h
View File

@ -10,7 +10,34 @@
namespace hr {
using namespace std;
// functions and types used from the standard library
using std::vector;
using std::map;
using std::array;
using std::unordered_map;
using std::sort;
using std::multimap;
using std::set;
using std::string;
using std::function;
using std::pair;
using std::tuple;
using std::shared_ptr;
using std::make_shared;
using std::min;
using std::max;
using std::make_pair;
using std::tie;
using std::queue;
using std::swap;
using std::complex;
using std::reverse;
using std::real;
using std::imag;
using std::stable_sort;
using std::out_of_range;
using std::get;
using std::random_shuffle;
// genus (in grammar)
#define GEN_M 0
@ -369,9 +396,7 @@ string cts(char c);
string its(int i);
int hrand(int i);
#ifndef STDSIZE
template<class T> int size(const T& x) {return x.size(); }
#endif
// initialize the achievement system.
void achievement_init();

View File

@ -93,7 +93,7 @@ namespace hr { namespace inv {
return int(mirrorqty0(orb) * sqrt(1.000001+items[itPower]/20.));
}
mt19937 invr;
std::mt19937 invr;
void sirand(int i) {
invr.seed(i);

View File

@ -9,14 +9,17 @@
#include <map>
#include <string>
#include <stdio.h>
#include <cstdio>
#include <vector>
#include <stdlib.h>
using namespace std;
#include <cstdlib>
#include <set>
using std::string;
using std::map;
using std::vector;
using std::set;
#ifndef STDSIZE
template<class T> int size(const T& x) { return x.size(); }
#endif
#define NUMLAN 7
@ -44,8 +47,6 @@ struct noun {
dictionary<noun> nouns[NUMLAN];
#include <set>
int utfsize(char c) {
unsigned char cu = c;
if(cu < 128) return 1;

View File

@ -577,7 +577,7 @@ namespace sag {
return cost;
}
mt19937 los;
std::mt19937 los;
bool infullsa;