Ejemplo n.º 1
0
        private void ParseFieldData(Internal.ByteArray message)
        {
            UnityEngine.Vector3Int absolutePosition = message.ReadPosition();
            if (!WorldMapStorage.IsVisible(absolutePosition, true))
            {
                throw new System.Exception("ProtocolGame.ParseFieldData: Co-ordinate " + absolutePosition + " is out of range.");
            }

            var mapPosition = WorldMapStorage.ToMap(absolutePosition);

            WorldMapStorage.ResetField(mapPosition, true, false);
            ReadField(message, mapPosition.x, mapPosition.y, mapPosition.z);

            if (absolutePosition.z == MiniMapStorage.PositionZ)
            {
                WorldMapStorage.UpdateMiniMap(mapPosition);
                uint color = WorldMapStorage.GetMiniMapColour(mapPosition);
                int  cost  = WorldMapStorage.GetMiniMapCost(mapPosition);
                MiniMapStorage.UpdateField(absolutePosition, color, cost, false);
            }
        }