Created
September 3, 2014 14:19
-
-
Save Brachamul/3347397c1736d78482c1 to your computer and use it in GitHub Desktop.
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
class Feature(models.Model): | |
# A feature is what occupies a slot, it can be a man-made constuct or natural terrain. | |
name = models.CharField(max_length=255) |
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
class MapLayout(models.Model): | |
name = models.CharField(max_length=255) | |
image = models.ImageField(upload_to=/maps/) | |
class Slot(models.Model): | |
map_layout = models.ForeignKey(MapLayout) | |
number = models.PositiveSmallIntegerField() # The ID of this Slot within a map. | |
longitude = models.PositiveSmallIntegerField() | |
latitude = models.PositiveSmallIntegerField() | |
starting_feature = models.ForeignKey(Feature) # The feature feature exists on the Slot when a game begins. |
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
class Town(models.Model): | |
name = models.CharField(max_length=255) | |
map_layout = models.ForeignKey(MapLayout) | |
class TownSlot(models.Model): | |
town = models.ForeignKey(Town) | |
slot = models.ForeignKey(Slot) # Defines the coordinates and starting feature of this Slot | |
feature = models.ForeignKey(Feature) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment