Creating structure for the game events (#3)
* Adding the GameVent model and migration * Initializing the GameEvent endpoint * GameEvent listing endpoint * Adding CLICK_NAIVE event * Added signal for identify what is on the click location * Using row and col integer is better than metadata with jsonfield * Create event for the same position is not allowed * Better signals control * Adding a board progress to Game model * Identifying the win status * Hide generated board from client
This commit is contained in:
41
game/migrations/0004_auto_20201106_0453.py
Normal file
41
game/migrations/0004_auto_20201106_0453.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# Generated by Django 3.1.3 on 2020-11-06 04:53
|
||||
|
||||
from django.db import migrations, models
|
||||
import game.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("game", "0003_gameevent"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name="gameevent",
|
||||
options={
|
||||
"ordering": ["created_at"],
|
||||
"verbose_name": "Game event",
|
||||
"verbose_name_plural": "Game events",
|
||||
},
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name="gameevent",
|
||||
name="type",
|
||||
field=models.IntegerField(
|
||||
choices=[
|
||||
(0, "START_GAME"),
|
||||
(1, "PAUSE"),
|
||||
(2, "RESUME"),
|
||||
(3, "CLICK_MINE"),
|
||||
(4, "CLICK_POINT"),
|
||||
(5, "CLICK_EMPTY"),
|
||||
(6, "CLICK_FLAG"),
|
||||
(7, "GAME_OVER"),
|
||||
(8, "CLICK_NAIVE"),
|
||||
],
|
||||
default=game.models.EventTypes["START_GAME"],
|
||||
help_text="The game event",
|
||||
),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user