Skip to content

Commit

Permalink
replacing with an explicit list
Browse files Browse the repository at this point in the history
  • Loading branch information
zenorogue committed Jun 17, 2018
1 parent dabf322 commit d320025
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 14 deletions.
4 changes: 2 additions & 2 deletions game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -161,7 +161,7 @@ ld hrandf() {
}

int hrandstate() {
mt19937 r2 = r;
std::mt19937 r2 = r;
return r2() & HRANDMAX;
}

Expand Down
31 changes: 28 additions & 3 deletions hyper.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 8 additions & 7 deletions langen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion rogueviz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ namespace sag {
return cost;
}

mt19937 los;
std::mt19937 los;

bool infullsa;

Expand Down

0 comments on commit d320025

Please sign in to comment.