NetworkReview.Restaurant.cs
using Sandbox;
using System.Linq;
namespace PaintballBaddies;
public sealed partial class NetworkReview
{
// Runs only in the explicit temporary multiplayer review fixture.
private object RestaurantServiceReport()
{
var expansion=Scene.GetAllComponents<RestaurantServiceExpansion>().FirstOrDefault();
bool Clear(float from,float to,float y,float floor)
{
var trace=Scene.Trace.Capsule(new Capsule(Vector3.Up*17,Vector3.Up*57,17),
new Vector3(from,y,floor),new Vector3(to,y,floor))
.WithoutTags("paintball_actor","overdrive_enemy","paintball_debris").Run();
return !trace.Hit && !trace.StartedSolid;
}
return new {expansion?.Ready,expansion?.GeometryReady,expansion?.Error,
KitchenClear=Clear(380,550,1768,35),DockClear=Clear(700,815,1143,43),
Supported=new[]{new Vector3(-340,1360,33),new Vector3(600,1400,33),new Vector3(940,1295,34),new Vector3(900,1143,45)}
.All(p=>Scene.Trace.Ray(p+Vector3.Up*6,p-Vector3.Up*12).WithoutTags("paintball_actor","overdrive_enemy","paintball_debris").Run().Hit),
Architecture=Scene.GetAllComponents<ModelRenderer>().Any(r=>r.GameObject.Name=="Restaurant service architecture" && r.Model?.IsError==false),
UpperFinish=Scene.GetAllComponents<ModelRenderer>().Any(r=>r.GameObject.Name=="Diner upper wall finish" && r.Model?.IsError==false),
GlassError=Material.Load("materials/arena_finish/diner_glass.vmat").IsError,
Routes=Scene.GetAllComponents<KitchenDoorways>().FirstOrDefault()?.Routes.Count,
Van=Scene.GetAllComponents<ModelRenderer>().Any(r=>r.GameObject.Name=="Restaurant delivery van" && r.Model?.IsError==false),
OriginalWorldLoaded=Scene.GetAllComponents<MapInstance>().Any(m=>m.Enabled && m.IsLoaded)};
}
}