コード例 #1
0
            /// <summary>
            /// Adds a route to the appropriate list for its type; returns the route.
            /// </summary>
            public Route Add(Route route)
            {
                switch (route)
                {
                case Route.MufflingBoxLink r: MufflingBoxLinks.Add(r); break;

                case Route.MufflingPortalLink r: MufflingPortalLinks.Add(r); break;

                default:
                    throw new ArgumentException($"Unrecognized type {route.GetType()}.", nameof(route));
                }
                return(route);
            }
コード例 #2
0
            internal override Route ReadEntry(BinaryReaderEx br)
            {
                RouteType type = br.GetEnum32 <RouteType>(br.Position + 0x10);

                switch (type)
                {
                case RouteType.MufflingPortalLink:
                    return(MufflingPortalLinks.EchoAdd(new Route.MufflingPortalLink(br)));

                case RouteType.MufflingBoxLink:
                    return(MufflingBoxLinks.EchoAdd(new Route.MufflingBoxLink(br)));

                default:
                    throw new NotImplementedException($"Unimplemented route type: {type}");
                }
            }