wesnoth/src/random.hpp
Tomasz Śniatowski 6c82272234 Server side RNG, client part draft.
There are two different approaches here:

 - in the AI code, the attack is queued, sent to the server and then
   the attacking code waits for a new random seed o arrive, polling UI
   events and syncing network in a loop.

 - in the player code, the actual attak procedure is delayed until
   after a new seed arrives by means of a callback that is called when
   a seed message is received. This is potentially problematic as, for
   example, commands need to be disabled across different scopes.
2009-07-19 22:09:31 +01:00

44 lines
934 B
C++

/* $Id$ */
/*
Copyright (C) 2003 by David White <dave@whitevine.net>
Copyright (C) 2005 - 2009 by Yann Dirson <ydirson@altern.org>
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
or at your option any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
See the COPYING file for more details.
*/
/** @file random.hpp */
#ifndef RANDOM_HPP_INCLUDED
#define RANDOM_HPP_INCLUDED
class config;
int get_random();
const config* get_random_results();
void set_random_results(const config& cfg);
namespace rand_rng
{
typedef unsigned int seed_t;
class rng;
struct set_random_generator {
set_random_generator(rng* r);
~set_random_generator();
private:
rng* old_;
};
} // ends rand_rng namespace
#endif