Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.db import models
- class GameInfo(models.Model):
- game_id = models.CharField(max_length=30, primary_key=True)
- played_map = models.CharField(max_length=30)
- round_number = models.IntegerField(max_lenght=2)
- t_scoure = models.IntegerField(max_lenght=2)
- ct_scoure = models.IntegerField(max_lenght=2)
- winner = models.CharField(max_length=20)
- win_reason = models.CharField(max_length=30) #win_reason contains the winning team, so the winner might be unnecessary information
- def __str__(self):
- return self.played_map + ' - ' + self.win_reason
- class PlayerData(models.Model):
- game_id = models.ForeignKey(GameInfo, on_delete=models.CASCADE)
- time = models.DecimalField(max_digits=6, decimal_places=3) #This time comes when on tick intervals (1/16 currently or 0.5s), so they do not match PlayerData time stamps, which log times when nades are thrown.
- t1_pos = models.CharField(max_length=30)
- t2_pos = models.CharField(max_length=30)
- t3_pos = models.CharField(max_length=30)
- t4_pos = models.CharField(max_length=30)
- t5_pos = models.CharField(max_length=30)
- t1_weapon = models.CharField(max_length=30)
- t2_weapon = models.CharField(max_length=30)
- t3_weapon = models.CharField(max_length=30)
- t4_weapon = models.CharField(max_length=30)
- t5_weapon = models.CharField(max_length=30)
- ct1_pos = models.CharField(max_length=30)
- ct2_pos = models.CharField(max_length=30)
- ct3_pos = models.CharField(max_length=30)
- ct4_pos = models.CharField(max_length=30)
- ct5_pos = models.CharField(max_length=30)
- ct1_weapon = models.CharField(max_length=30)
- ct2_weapon = models.CharField(max_length=30)
- ct3_weapon = models.CharField(max_length=30)
- ct4_weapon = models.CharField(max_length=30)
- ct5_weapon = models.CharField(max_length=30)
- def __str__(self):
- return self.game_id
- class Nades(models.Model):
- game_id = models.ForeignKey(GameInfo, on_delete=models.CASCADE)
- time = models.DecimalField(max_digits=6, decimal_places=3) #This time comes when nades explode not on a tick interval, so they do not match PlayerData time stamps
- nadetype = models.CharField(max_length=15)
- def __str__(self):
- return self.game_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement