// Создать изменения для добавления новых определений сущностей
        private IList <StateChange> CreateNewEntityDefsChange(ChangeData data)
        {
            string templateName = data["template"] as string;
            var    defNames     = (data["defNames"] as object[]).Cast <string>().ToArray();
            var    message      = new AddDefinitions(templateName, defNames);

            return(new StateChange[] { StateChange.CreateInternal(message) });
        }
        // Создать изменение состояния для заданного сообщения
        private StateChange CreateChange(OutgoingMessage message, ChangeData data)
        {
            object receivers = data["to"];

            if (receivers == null || (receivers as string) == "*")
            {
                return(StateChange.CreateBroadcast(message));
            }
            else if (receivers is double[] seatIdxs)
            {
                var targetPlayers = seatIdxs.Cast <int>().Select(idx =>
                {
                    return(session.Room.PlayerSeats[idx]);
                }).ToArray();
                return(StateChange.CreateFor(message, targetPlayers));
            }
            else
            {
                int targetSeatIdx = (int)(double)receivers; // Unboxing
                var targetPlayer  = session.Room.PlayerSeats[targetSeatIdx];
                return(StateChange.CreateFor(message, new[] { targetPlayer }));
            }
        }