-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpaceDoggos.sol
42 lines (34 loc) · 1009 Bytes
/
SpaceDoggos.sol
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
42
pragma solidity ^0.4.20;
contract SpaceDoggos {
uint maxPlanetsPerSystem = 10;
uint minPlanetsPerSystem = 3;
uint planetCodeDigits = 7;
uint systemCodeDigits = 7;
uint planetCodeModulus = 10 ** planetCodeDigits;
uint systemCodeModulus = 10 ** systemCodeDigits;
struct Doggo {
string name;
uint8 breed;
uint8 color;
uint8 face;
uint8 costume;
uint coordX;
uint coordY;
}
mapping(address => Doggo) doggos;
function createDoggo(string _name, uint8 _breed, uint8 _color, uint8 _face, uint8 _costume) {
Doggo memory myDoggo = Doggo({
name: _name,
breed: _breed,
color: _color,
face: _face,
costume: _costume,
coordX: 0,
coordY: 0
});
doggos[msg.sender] = myDoggo;
}
function getSystemMap(uint _coordX, uint _coordY) returns (uint) {
return uint(keccak256(_coordX, _coordY));
}
}