Exemple #1
0
        public State(State parentIn, List <string[]> RTGIn, int floorIn)
        {
            RTG   = RTGIn.ToList();
            Floor = floorIn;
            int max = 4 * RTG.SelectMany(a => a).Count();

            Parent = parentIn;
            Cost   = Parent is null? 0 : parentIn.Cost + 1;
            UpdateState();
        }
Exemple #2
0
        private void SerializeState()
        {
            string result = $"{Floor} ";

            //result = "";
            foreach (var(floor, index) in RTG.WithIndex())
            {
                result += $"";
                result += string.Join($"", floor.OrderBy(a => a).ToArray());
                result += $"|";
            }
            Serialized = result;
        }