Example #1
0
        private void ProcessTranzitionLine(string line)
        {
            var tranzitionDetails = line.Split(", ");
            var fromRoom          = int.Parse(tranzitionDetails[0]);
            var toRoom            = int.Parse(tranzitionDetails[1]);
            var transitionType    = tranzitionDetails[2];
            var moveCost          = int.Parse(tranzitionDetails[3]);
            var isBidirectional   = tranzitionDetails[4].Equals("yes");

            building.AddTransition(fromRoom, new Transition(fromRoom, toRoom, transitionType, moveCost, isBidirectional));

            if (isBidirectional)
            {
                building.AddTransition(toRoom, new Transition(toRoom, fromRoom, transitionType, moveCost, isBidirectional));
            }
        }