diff --git a/src/common/proto/game.proto b/src/common/proto/game.proto index ca59ccd..b0e3473 100644 --- a/src/common/proto/game.proto +++ b/src/common/proto/game.proto @@ -2,7 +2,116 @@ syntax = "proto3"; package ru.m.tankz.proto.game; +message PositionProto { + float x = 1; + float y = 2; +} + +message RectangleProto { + float x = 1; + float y = 2; + float width = 3; + float height = 4; +} + +message ShotProto { + int32 tankId = 1; + int32 bulletId = 2; + int32 score = 3; +} + +message BrickProto { + int32 gridX = 1; + int32 gridY = 2; + string type = 3; +} + +message EagleProto { + string team = 1; +} + +message TankProto { + string team = 1; + int32 index = 2; + string type = 3; + int32 hits = 4; + bool bonus = 5; + int32 color = 6; + string name = 7; +} + +message BulletProto { + string team = 1; + int32 index = 2; + int32 piercing = 3; +} + +message BonusProto { + string type = 1; +} + +message GameStateProto { + string state = 1; +} + +message GameEventStartProto { + GameStateProto state = 1; +} + +message GameEventCompleteProto { + GameStateProto state = 1; +} + +message GameEventSpawnProto { + int32 entityId = 1; + RectangleProto rectangle = 2; + oneof entity { + EagleProto eagle = 3; + TankProto tank = 4; + BulletProto bullet = 5; + BonusProto bonus = 6; + BrickProto bricks = 7; + } +} + +message GameEventMoveProto { + int32 entityId = 1; + PositionProto position = 2; +} + +message GameEventStopProto { + int32 entityId = 1; +} + +message GameEventHitProto { + int32 entityId = 1; + ShotProto shot = 2; +} + +message GameEventDestroyProto { + int32 entityId = 1; + ShotProto shot = 2; +} + +message GameEventActionProto { + int32 entityId = 1; + oneof action { + PositionProto move = 2; + bool stop = 3; + bool shot = 4; + } +} + message GameEventProto { int32 time = 1; - string event = 2; + oneof event { + GameEventStartProto start = 2; + GameEventCompleteProto complete = 3; + GameEventSpawnProto spawn = 4; + GameEventMoveProto move = 5; + GameEventStopProto stop = 6; + GameEventHitProto hit = 7; + GameEventDestroyProto destroy = 8; + GameEventActionProto action = 9; + } }