forked from LetItPlay/CryptoWizards-SmartContract
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wizard.hpp
41 lines (30 loc) · 837 Bytes
/
wizard.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#pragma once
#include <eosiolib/eosio.hpp>
#include <eosiolib/types.hpp>
#include <eosiolib/asset.hpp>
using namespace eosio;
using namespace std;
#define myN(accName) N(accName)
//account names
#define WIZARDSTOKEN wizardstoken
//#define WIZARDSTOKEN opcheese1234
#define MAX_UINT64 std::numeric_limits<uint64_t>::max()
//@abi table wizards i64
struct wizard {
wizard() {
phenotype = vector<uint8_t>(20);
};
uint64_t id;
//genotype
vector<uint8_t> genotype;
//phenotype
vector<uint8_t> phenotype;
asset original_cost;
void wear(uint8_t index, uint8_t weight) {
phenotype[10 + index] = weight;
eosio::print("new rag!");
}
uint64_t primary_key() const { return id; }
EOSLIB_SERIALIZE( wizard, (id)(genotype)(phenotype)(original_cost))
};
typedef eosio::multi_index<N(wizards), wizard> wizardsT;