/// <summary> /// Create the template output /// </summary> public virtual string TransformText() { this.Write("using System.Collections.Generic;\r\nusing Entitas;\r\nusing Sources.Networking.Serve" + "r;\r\n\r\n"); #line 9 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" var name = ComponentName.Replace("Component", ""); var firstLowerName = char.ToLowerInvariant(name[0]) + name.Substring(1); #line default #line hidden this.Write("\r\npublic class ServerCaptureChanged"); #line 14 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" this.Write(this.ToStringHelper.ToStringWithCulture(name)); #line default #line hidden this.Write("System : ReactiveSystem<GameEntity>\r\n{\r\n\tprivate readonly ServerNetworkSystem _se" + "rver;\r\n\tpublic ServerCaptureChanged"); #line 17 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" this.Write(this.ToStringHelper.ToStringWithCulture(name)); #line default #line hidden this.Write("System (Contexts contexts, Services services) : base(contexts.game)\r\n\t{\r\n\t\t_serve" + "r = services.ServerSystem;\r\n\t}\r\n\t\t\r\n\tprotected override ICollector<GameEntity> G" + "etTrigger(IContext<GameEntity> context) {\r\n\t\treturn context.CreateCollector(Game" + "Matcher."); #line 23 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" this.Write(this.ToStringHelper.ToStringWithCulture(name)); #line default #line hidden this.Write(".Added());\r\n\t}\r\n\t\t\r\n\tprotected override bool Filter(GameEntity entity)\r\n\t{\r\n"); #line 28 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" if (IsTag) { #line default #line hidden this.Write(" return !entity.isDestroyed && entity.isWasSynced && entity.is"); #line 32 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" this.Write(this.ToStringHelper.ToStringWithCulture(name)); #line default #line hidden this.Write(";\r\n"); #line 33 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" } else { #line default #line hidden this.Write(" return !entity.isDestroyed && entity.isWasSynced && entity.has"); #line 38 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" this.Write(this.ToStringHelper.ToStringWithCulture(name)); #line default #line hidden this.Write(";\r\n"); #line 39 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" } #line default #line hidden this.Write("\t}\r\n\r\n\tprotected override void Execute(List<GameEntity> entities) {\r\n\t\tif (_serve" + "r.State != ServerState.Working) return;\r\n\r\n\t\tforeach (var e in entities) {\r\n\t\t " + " _server.ChangedComponents.AddUShort(e.id.Value);\r\n"); #line 49 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" if (IsTag) { #line default #line hidden this.Write(" _server.ChangedComponents.AddUShort("); #line 53 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" this.Write(this.ToStringHelper.ToStringWithCulture(ComponentId)); #line default #line hidden this.Write(");\r\n"); #line 54 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" } else { #line default #line hidden this.Write(" e."); #line 59 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" this.Write(this.ToStringHelper.ToStringWithCulture(firstLowerName)); #line default #line hidden this.Write(".Serialize(_server.ChangedComponents);\r\n"); #line 60 "C:\UnityProjects\Entitas-Sync\Generators\Generators\Generators\Sync\Systems\SyncChangedComponentSystemGenerator.tt" } #line default #line hidden this.Write("\t\t\t_server.ChangedComponentsCount++;\r\n\t\t}\r\n\t}\r\n}"); return(this.GenerationEnvironment.ToString()); }