Permalink
Browse files

Basic cleanup

The changes to structures mean createstructures.py is no longer
necessary.  Removing the old structures code meant .gitignore could
have the structures references removed.  Finally, the change to
enumeration over the baseindices dict meant bindices did not need
to be calculated.

.gitignore: cleaned
createstructures.py: removed
newcl.py: cleaned
  • Loading branch information...
1 parent 7dc7842 commit f5b9c7bace6b2573892d49e49e7c0987e8441c78 @mathuin committed Feb 17, 2012
Showing with 0 additions and 71 deletions.
  1. +0 −1 .gitignore
  2. +0 −69 createstructures.py
  3. +0 −1 newcl.py
View
@@ -1,4 +1,3 @@
# ignore compiled Python files
*.pyc
*~
-structure-*.yaml
View
@@ -1,69 +0,0 @@
-# create structures for Terrain module
-
-from newterrain import Terrain
-
-# farmland
-
-def createcrops():
- # Two rows, farm and path. One path every nine rows of farm.
- farm = [
- [(1, 'Farmland'), (1, ('Crops', 7))],
- [(1, 'Farmland'), (1, ('Crops', 7))],
- [(1, 'Water'), (1, 'Air')],
- [(1, 'Farmland'), (1, ('Crops', 7))],
- [(1, 'Farmland'), (1, ('Crops', 7))],
- [(1, 'Cobblestone'), (1, 'Air')],
- [(1, 'Farmland'), (1, 'Air')],
- [(1, 'Farmland'), (1, ('Melon Stem', 7))],
- [(1, 'Water'), (1, 'Air')],
- [(1, 'Farmland'), (1, ('Pumpkin Stem', 7))],
- [(1, 'Farmland'), (1, 'Air')],
- [(1, 'Cobblestone'), (1, 'Air')] ]
- path = [
- [(1, 'Cobblestone'), (1, 'Air')],
- [(1, 'Cobblestone'), (1, 'Stone Stairs')],
- [(1, 'Water'), (1, 'Cobblestone')],
- [(1, 'Cobblestone'), (1, ('Stone Stairs', 1))],
- [(1, 'Cobblestone'), (1, 'Air')],
- [(1, 'Cobblestone'), (1, 'Air')],
- [(1, 'Cobblestone'), (1, 'Air')],
- [(1, 'Cobblestone'), (1, 'Stone Stairs')],
- [(1, 'Water'), (1, 'Cobblestone')],
- [(1, 'Cobblestone'), (1, ('Stone Stairs', 1))],
- [(1, 'Cobblestone'), (1, 'Air')],
- [(1, 'Cobblestone'), (1, 'Air')] ]
- layout = [farm, farm, farm, farm, farm, farm, farm, farm, farm, path]
- offset = 1
- newcrops = Terrain.newstructure(layout, offset)
- Terrain.checkstructure(newcrops, verbose=True)
- Terrain.savestructure(newcrops, 'crops')
-
-def createdeveloped():
- # Simple building
- air = [(1, 'Stone'), (5, 'Air')]
- corner = [(6, 'Stone')]
- wall = [(3, 'Stone'), (2, 'Glass'), (1, 'Stone')]
- middle = [(1, 'Stone'), (4, 'Air'), (1, 'Stone')]
- opening = [(1, 'Stone'), (2, 'Air'), (3, 'Stone')]
- layout = [
- [air, air, air, air, air, air, air],
- [air, corner, wall, wall, wall, corner, air],
- [air, wall, middle, middle, middle, wall, air],
- [air, wall, middle, middle, middle, wall, air],
- [air, wall, middle, middle, middle, wall, air],
- [air, wall, middle, middle, middle, wall, air],
- [air, corner, wall, opening, wall, corner, air],
- [air, air, air, air, air, air, air]
- ]
- offset=1
- developed = Terrain.newstructure(layout, offset)
- Terrain.checkstructure(developed, verbose=True)
- Terrain.savestructure(developed, 'developed')
-
-def createstructures():
- createcrops()
- createdeveloped()
-
-if __name__ == '__main__':
- createstructures()
-
View
@@ -115,7 +115,6 @@ def __call__(self):
pairs = [(c, d) for c, d in product(xrange(a-1,a+2), xrange(b-1,b+2)) if (c,d) in self.coordindices.keys()]
for pair in pairs:
cindices += self.coordindices[pair]
- bindices = self.baseindices[key]
coords = self.coords[cindices]
values = self.values[cindices]
base = self.base[value]

0 comments on commit f5b9c7b

Please sign in to comment.