From 64d18650222bff6079d0f8e1ddd36224225d7a60 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 17 Feb 2019 06:34:57 -1100 Subject: [PATCH] rogue_player.h --- src/cc/rogue/rogue.h | 15 +-------------- src/cc/rogue/rogue_player.h | 35 +++++++++++++++++++++++++++++++++++ src/cc/rogue_rpc.cpp | 17 +---------------- 3 files changed, 37 insertions(+), 30 deletions(-) create mode 100644 src/cc/rogue/rogue_player.h diff --git a/src/cc/rogue/rogue.h b/src/cc/rogue/rogue.h index a5ddf943f..905a5ed36 100644 --- a/src/cc/rogue/rogue.h +++ b/src/cc/rogue/rogue.h @@ -357,20 +357,7 @@ union _bits256 { uint8_t bytes[32]; uint16_t ushorts[16]; uint32_t uints[8]; uin typedef union _bits256 bits256; #endif - -#ifndef ROGUE_DECLARED_PACK -struct rogue_packitem -{ - int32_t type,launch,count,which,hplus,dplus,arm,flags,group; - char damage[8],hurldmg[8]; -}; -struct rogue_player -{ - int32_t gold,hitpoints,strength,level,experience,packsize,dungeonlevel,pad; - struct rogue_packitem roguepack[MAXPACK]; -}; -#define ROGUE_DECLARED_PACK -#endif +#include "rogue_player.h" // interface to rpc struct rogue_state { diff --git a/src/cc/rogue/rogue_player.h b/src/cc/rogue/rogue_player.h new file mode 100644 index 000000000..1319b3213 --- /dev/null +++ b/src/cc/rogue/rogue_player.h @@ -0,0 +1,35 @@ +/****************************************************************************** + * Copyright © 2014-2019 The SuperNET Developers. * + * * + * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at * + * the top-level directory of this distribution for the individual copyright * + * holder information and the developer policies on copyright and licensing. * + * * + * Unless otherwise agreed in a custom licensing agreement, no part of the * + * SuperNET software, including this file may be copied, modified, propagated * + * or distributed except according to the terms contained in the LICENSE file * + * * + * Removal or modification of this copyright notice is prohibited. * + * * + ******************************************************************************/ + +#ifndef ROGUE_DECLARED_PACK +#define ROGUE_DECLARED_PACK + + +#define MAXPACK 23 +struct rogue_packitem +{ + int32_t type,launch,count,which,hplus,dplus,arm,flags,group; + char damage[8],hurldmg[8]; +}; +struct rogue_player +{ + int32_t gold,hitpoints,strength,level,experience,packsize,dungeonlevel,pad; + struct rogue_packitem roguepack[MAXPACK]; +}; +int32_t rogue_replay2(uint8_t *newdata,uint64_t seed,char *keystrokes,int32_t num,struct rogue_player *player,int32_t sleepmillis); +void rogue_packitemstr(char *packitemstr,struct rogue_packitem *item); + +#endif + diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index 7b26ff572..253f3ec89 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -23,22 +23,7 @@ #define ROGUE_MAXKEYSTROKESGAP 60 #define ROGUE_MAXITERATIONS 777 - -#define MAXPACK 23 -struct rogue_packitem -{ - int32_t type,launch,count,which,hplus,dplus,arm,flags,group; - char damage[8],hurldmg[8]; -}; -struct rogue_player -{ - int32_t gold,hitpoints,strength,level,experience,packsize,dungeonlevel,pad; - struct rogue_packitem roguepack[MAXPACK]; -}; -int32_t rogue_replay2(uint8_t *newdata,uint64_t seed,char *keystrokes,int32_t num,struct rogue_player *player,int32_t sleepmillis); -#define ROGUE_DECLARED_PACK -void rogue_packitemstr(char *packitemstr,struct rogue_packitem *item); - +#include "rogue/rogueplayer.h" std::string Rogue_pname = "";