This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documented level generation and map generation. Introducing a level s…
…hould be easy now as long as the Django part has the right migrations.
- Loading branch information
Showing
6 changed files
with
152 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
import hashlib | ||
|
||
class CellTransform(): | ||
def __init__(self, x, y): | ||
self.x = x | ||
self.y = y | ||
""" | ||
A transform is a function callable from objects.json. E.g.: | ||
{ | ||
"code": "1", | ||
"id" : "class:CellTransform.compute_id", | ||
"x" : "class:CellTransform.get_x", | ||
"y" : "class:CellTransform.get_y" | ||
} | ||
def compute_id(self): | ||
return hash(str(self.x) + ":" + str(self.y)) | ||
A transform has to be registered to a parser. | ||
""" | ||
def __init__(self, x, y): | ||
self.x = x | ||
self.y = y | ||
|
||
def get_x(self): | ||
return self.x | ||
def compute_id(self): | ||
return hash(str(self.x) + ":" + str(self.y)) | ||
|
||
def get_y(self): | ||
return self.y | ||
def get_x(self): | ||
return self.x | ||
|
||
def get_y(self): | ||
return self.y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters