Esempio n. 1
0
 def __init__(self, json_in):
     self.data = json.loads(json_in)
     self.sid = ship.myid
     ship.myid += 1
     
     self.name = self.data["name"]
     self.desc = self.data["desc"]
     self.dice = []
     for d in self.data["dice"]:
         self.dice.append(die(d))
     self.actions = []
     for a in self.data["actions"]:
         self.actions.append(action(a))
Esempio n. 2
0
    def __init__(self, json_in):
        self.data = json.loads(json_in)
        self.sid = ship.myid
        ship.myid += 1

        self.name = self.data["name"]
        self.desc = self.data["desc"]
        self.dice = []
        for d in self.data["dice"]:
            self.dice.append(die(d))
        self.actions = []
        for a in self.data["actions"]:
            self.actions.append(action(a))
Esempio n. 3
0
        ],
    "limit":{
        "phase":1,
        "turn":2,
        },
    "scope":[
        "any",
        ],
    "result":[
        {"attack":1,"shield":1,},
        {"attack":6},
        ],
    }
dsample_one = die(json.dumps(dsample1))
dsample_two = die(json.dumps(dsample2))
asample_one = action(json.dumps(asample))

ssample = {
    "name":"frigate",
    "desc":"A basic attack frigate.",
    "dice":[
        dsample_one.json(),
        dsample_two.json(),
        ],
    "actions":[
        asample_one.json(),
        ]
    }

myship = ship(json.dumps(ssample))
print myship.name
Esempio n. 4
0
    "scope": [
        "any",
    ],
    "result": [
        {
            "attack": 1,
            "shield": 1,
        },
        {
            "attack": 6
        },
    ],
}
dsample_one = die(json.dumps(dsample1))
dsample_two = die(json.dumps(dsample2))
asample_one = action(json.dumps(asample))

ssample = {
    "name": "frigate",
    "desc": "A basic attack frigate.",
    "dice": [
        dsample_one.json(),
        dsample_two.json(),
    ],
    "actions": [
        asample_one.json(),
    ]
}

myship = ship(json.dumps(ssample))
print myship.name