public Routeway CreateRouteway(List<Point> pointlist) { int num2; Routeway routeway = new Routeway(); routeway.Scenario = base.Scenario; routeway.ID = base.Scenario.Routeways.GetFreeGameObjectID(); routeway.Scenario.Routeways.AddRoutewayWithEvent(routeway); this.BelongedFaction.AddRouteway(routeway); routeway.StartArchitecture = this; this.Routeways.Add(routeway); GameArea routewayStartPoints = this.GetRoutewayStartPoints(); int num = 0; for (num2 = 0; num2 < pointlist.Count; num2++) { if (routewayStartPoints.HasPoint(pointlist[num2])) { num = num2; } } for (num2 = num; num2 < pointlist.Count; num2++) { routeway.Extend(pointlist[num2]); } ExtensionInterface.call("CreateRouteway", new Object[] { this.Scenario, this, routeway }); return routeway; }
public Routeway CreateRouteway(Point p) { if (base.Scenario.GetTerrainDetailByPosition(p) != null) { Routeway routeway = new Routeway(); routeway.Scenario = base.Scenario; routeway.ID = base.Scenario.Routeways.GetFreeGameObjectID(); routeway.Scenario.Routeways.AddRoutewayWithEvent(routeway); this.BelongedFaction.AddRouteway(routeway); routeway.StartArchitecture = this; this.Routeways.Add(routeway); routeway.Extend(p); ArchitectureList routewayArchitecturesByPosition = base.Scenario.GetRoutewayArchitecturesByPosition(routeway, p); if (routewayArchitecturesByPosition.Count > 0) { if (routewayArchitecturesByPosition.Count > 1) { routewayArchitecturesByPosition.PropertyName = "Food"; routewayArchitecturesByPosition.IsNumber = true; routewayArchitecturesByPosition.SmallToBig = true; routewayArchitecturesByPosition.ReSort(); } routeway.EndArchitecture = routewayArchitecturesByPosition[0] as Architecture; routeway.DestinationArchitecture = routeway.EndArchitecture; } ExtensionInterface.call("CreateRouteway", new Object[] { this.Scenario, this, routeway }); return routeway; } return null; }