Skip to content

Yyy #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Editor/Frontends/SyntaxRewriters/SyntaxUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public static ArgumentListSyntax ArgumentList(params ExpressionSyntax[] argument
return SyntaxFactory.ArgumentList(SyntaxFactory.SeparatedList<ArgumentSyntax>(withCommas));
}
public static TypeArgumentListSyntax TypeArgumentList(params TypeSyntax[] arguments)
{
return TypeArgumentList((IEnumerable<TypeSyntax>)arguments);
}
public static TypeArgumentListSyntax TypeArgumentList(IEnumerable<TypeSyntax> arguments)
{
var withCommas = CommaSeparated(arguments.Select(arg => (SyntaxNodeOrToken)arg));

Expand Down
459 changes: 57 additions & 402 deletions Runtime/Chips/ChipBuilder.cs

Large diffs are not rendered by default.

379 changes: 93 additions & 286 deletions Runtime/Chips/ClassChips/EventDefinitionBuild.cs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Runtime/Chips/ClassChips/VariableBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace RRCGBuild
{
public enum VariableKind
{
None = -1,
Local,
Synced,
Cloud
Expand Down
26 changes: 14 additions & 12 deletions Runtime/CircuitDescriptor/CircuitBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using UnityEngine;
using DeclaredVariable = RRCGBuild.AccessibilityScope.DeclaredVariable;
using PromotedVariable = RRCGBuild.ConditionalContext.PromotedVariable;

namespace RRCGBuild
Expand Down Expand Up @@ -299,51 +298,54 @@ public static void ExistingExecOutput(StringPort portName)
{
}

public static void StudioEventReceiver(string eventName)
public static void StudioEventReceiver(string eventName, Guid eventId = default)
{
CircuitBuilder.Singleton("StudioEventReceiver_" + eventName, () => EventDefinition(eventName));
EventReceiver(eventName);
CircuitBuilder.Singleton("StudioEventReceiver_" + eventName, () => EventDefinition(eventName, eventId));
if (eventId == Guid.Empty)
EventReceiver(eventName);
else
EventReceiver(eventId);
}

/// <summary>
/// Returns an Instance of the Event class for an already exising Event in the room
/// </summary>
public static EventDefinition ExistingEvent(string eventName)
public static EventDefinition ExistingEvent(string eventName, Guid eventId)
{
return new EventDefinition(true, eventName);
return new EventDefinition(eventId, eventName);
}

/// <summary>
/// Returns an Instance of the Event class for an already exising Event in the room.
/// With one Event parameter.
/// </summary>
public static EventDefinition<T0> ExistingEvent<T0>(string eventName)
public static EventDefinition<T0> ExistingEvent<T0>(string eventName, Guid eventId)
where T0 : AnyPort, new()
{
return new EventDefinition<T0>(true, eventName);
return new EventDefinition<T0>(eventId, eventName);
}

/// <summary>
/// Returns an Instance of the Event class for an already exising Event in the room.
/// With two Event parameter.
/// </summary>
public static EventDefinition<T0, T1> ExistingEvent<T0, T1>(string eventName)
public static EventDefinition<T0, T1> ExistingEvent<T0, T1>(string eventName, Guid eventId)
where T0 : AnyPort, new()
where T1 : AnyPort, new()
{
return new EventDefinition<T0, T1>(true, eventName);
return new EventDefinition<T0, T1>(eventId, eventName);
}

/// <summary>
/// Returns an Instance of the Event class for an already exising Event in the room.
/// With three Event parameter.
/// </summary>
public static EventDefinition<T0, T1, T2> ExistingEvent<T0, T1, T2>(string eventName)
public static EventDefinition<T0, T1, T2> ExistingEvent<T0, T1, T2>(string eventName, Guid eventId)
where T0 : AnyPort, new()
where T1 : AnyPort, new()
where T2 : AnyPort, new()
{
return new EventDefinition<T0, T1, T2>(true, eventName);
return new EventDefinition<T0, T1, T2>(eventId, eventName);
}

/// <summary>
Expand Down
8 changes: 8 additions & 0 deletions Runtime/Events.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Runtime/Events/Generated.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

107 changes: 107 additions & 0 deletions Runtime/Events/Generated/RoomEvent3.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
using RRCGSource;
using UnityEngine;
using System;

namespace RRCGSource
{
public class RoomEvent3
{
/// <summary>
/// Consumable Purchased
/// </summary>
public static void ConsumablePurchased(AlternativeExec<(Consumable consumable, int quantity)> onConsumablePurchased)
{
}

/// <summary>
/// Consumable Used
/// </summary>
public static void ConsumableUsed(AlternativeExec<Consumable> onConsumableUsed)
{
}

/// <summary>
/// DEPRECATED Local Player Spawned
/// </summary>
public static void DEPRECATEDLocalPlayerSpawned(AlternativeExec onDEPRECATEDLocalPlayerSpawned)
{
}

/// <summary>
/// DEPRECATED Player Left
/// </summary>
public static void DEPRECATEDPlayerLeft(AlternativeExec<Player> onDEPRECATEDPlayerLeft)
{
}

/// <summary>
/// Level Reached
/// </summary>
public static void LevelReached(AlternativeExec<int> onLevelReached)
{
}

/// <summary>
/// Player Joined
/// </summary>
public static void PlayerJoined(AlternativeExec<Player> onPlayerJoined)
{
}

/// <summary>
/// Player Leaving
/// </summary>
public static void PlayerLeaving(AlternativeExec<Player> onPlayerLeaving)
{
}

/// <summary>
/// Player Left
/// </summary>
public static void PlayerLeft(AlternativeExec<Player> onPlayerLeft)
{
}

/// <summary>
/// Room Authority Changed
/// </summary>
public static void RoomAuthorityChanged(AlternativeExec<Player> onRoomAuthorityChanged)
{
}

/// <summary>
/// Room Key Purchased
/// </summary>
public static void RoomKeyPurchased(AlternativeExec<RoomKey> onRoomKeyPurchased)
{
}

/// <summary>
/// Room Loaded
/// </summary>
public static void RoomLoaded(AlternativeExec onRoomLoaded)
{
}

/// <summary>
/// Room Reset
/// </summary>
public static void RoomReset(AlternativeExec onRoomReset)
{
}

/// <summary>
/// Test Event
/// </summary>
public static void TestEvent(AlternativeExec<string> onTestEvent)
{
}

/// <summary>
/// Update 30Hz
/// </summary>
public static void Update30Hz(AlternativeExec<float> onUpdate30Hz)
{
}
}
}
11 changes: 11 additions & 0 deletions Runtime/Events/Generated/RoomEvent3.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

152 changes: 152 additions & 0 deletions Runtime/Events/Generated/RoomEvent3Build.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
using RRCGSource;
using UnityEngine;
using System;

namespace RRCGBuild
{
public class RoomEvent3
{
public static void ConsumablePurchased(AlternativeExec<(ConsumablePort consumable, IntPort quantity)> onConsumablePurchased)
{
CircuitBuilder.InlineGraph(() =>
{
onConsumablePurchased(ChipBuilder.EventReceiver<(ConsumablePort consumable, IntPort quantity)>(Guid.ParseExact("b5678272-adbe-4e59-a833-bd156fd8f7fa", "D")));
}

);
}

public static void ConsumableUsed(AlternativeExec<ConsumablePort> onConsumableUsed)
{
CircuitBuilder.InlineGraph(() =>
{
onConsumableUsed(ChipBuilder.EventReceiver<ConsumablePort>(Guid.ParseExact("304464c2-e4ec-408c-9b6e-26788d9b0526", "D")));
}

);
}

public static void DEPRECATEDLocalPlayerSpawned(AlternativeExec onDEPRECATEDLocalPlayerSpawned)
{
CircuitBuilder.InlineGraph(() =>
{
ChipBuilder.EventReceiver(Guid.ParseExact("3c0c12fe-d760-48a3-b44e-b96850f82a4a", "D"));
onDEPRECATEDLocalPlayerSpawned();
}

);
}

public static void DEPRECATEDPlayerLeft(AlternativeExec<PlayerPort> onDEPRECATEDPlayerLeft)
{
CircuitBuilder.InlineGraph(() =>
{
onDEPRECATEDPlayerLeft(ChipBuilder.EventReceiver<PlayerPort>(Guid.ParseExact("f52effba-2c1b-4f0b-a661-7079b45710ff", "D")));
}

);
}

public static void LevelReached(AlternativeExec<IntPort> onLevelReached)
{
CircuitBuilder.InlineGraph(() =>
{
onLevelReached(ChipBuilder.EventReceiver<IntPort>(Guid.ParseExact("456a88e0-ed1d-4928-8af3-cb566ce19488", "D")));
}

);
}

public static void PlayerJoined(AlternativeExec<PlayerPort> onPlayerJoined)
{
CircuitBuilder.InlineGraph(() =>
{
onPlayerJoined(ChipBuilder.EventReceiver<PlayerPort>(Guid.ParseExact("a68a4b00-adf5-4aef-801a-fa6264771a9f", "D")));
}

);
}

public static void PlayerLeaving(AlternativeExec<PlayerPort> onPlayerLeaving)
{
CircuitBuilder.InlineGraph(() =>
{
onPlayerLeaving(ChipBuilder.EventReceiver<PlayerPort>(Guid.ParseExact("e8a19063-e8a2-40b0-a955-b0a23712aefa", "D")));
}

);
}

public static void PlayerLeft(AlternativeExec<PlayerPort> onPlayerLeft)
{
CircuitBuilder.InlineGraph(() =>
{
onPlayerLeft(ChipBuilder.EventReceiver<PlayerPort>(Guid.ParseExact("dd292b5d-5218-4d4a-abf4-aa9dbe283e50", "D")));
}

);
}

public static void RoomAuthorityChanged(AlternativeExec<PlayerPort> onRoomAuthorityChanged)
{
CircuitBuilder.InlineGraph(() =>
{
onRoomAuthorityChanged(ChipBuilder.EventReceiver<PlayerPort>(Guid.ParseExact("dc968273-75aa-455e-9aa4-58f4e9548e62", "D")));
}

);
}

public static void RoomKeyPurchased(AlternativeExec<RoomKeyPort> onRoomKeyPurchased)
{
CircuitBuilder.InlineGraph(() =>
{
onRoomKeyPurchased(ChipBuilder.EventReceiver<RoomKeyPort>(Guid.ParseExact("a6c9db82-c995-41f4-9e9e-2fa6241a21bf", "D")));
}

);
}

public static void RoomLoaded(AlternativeExec onRoomLoaded)
{
CircuitBuilder.InlineGraph(() =>
{
ChipBuilder.EventReceiver(Guid.ParseExact("5efce997-30d2-431f-b156-c4ebda8fb1ad", "D"));
onRoomLoaded();
}

);
}

public static void RoomReset(AlternativeExec onRoomReset)
{
CircuitBuilder.InlineGraph(() =>
{
ChipBuilder.EventReceiver(Guid.ParseExact("ba20b726-fbc4-400b-b6fd-f88804063378", "D"));
onRoomReset();
}

);
}

public static void TestEvent(AlternativeExec<StringPort> onTestEvent)
{
CircuitBuilder.InlineGraph(() =>
{
onTestEvent(ChipBuilder.EventReceiver<StringPort>(Guid.ParseExact("888ab607-ac44-422e-b3d7-94a219450484", "D")));
}

);
}

public static void Update30Hz(AlternativeExec<FloatPort> onUpdate30Hz)
{
CircuitBuilder.InlineGraph(() =>
{
onUpdate30Hz(ChipBuilder.EventReceiver<FloatPort>(Guid.ParseExact("1ac8f2f7-ca6e-4530-b19a-1b9a8de3954d", "D")));
}

);
}
}
}
11 changes: 11 additions & 0 deletions Runtime/Events/Generated/RoomEvent3Build.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading