forked from clockworklabs/SpacetimeDB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSetName.g.cs
More file actions
75 lines (64 loc) · 2.19 KB
/
SetName.g.cs
File metadata and controls
75 lines (64 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
// This was generated using spacetimedb cli version 1.2.0 (commit fb41e50eb73573b70eea532aeb6158eaac06fae0).
#nullable enable
using System;
using SpacetimeDB.ClientApi;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace SpacetimeDB.Types
{
public sealed partial class RemoteReducers : RemoteBase
{
public delegate void SetNameHandler(ReducerEventContext ctx, string name);
public event SetNameHandler? OnSetName;
public void SetName(string name)
{
conn.InternalCallReducer(new Reducer.SetName(name), this.SetCallReducerFlags.SetNameFlags);
}
public bool InvokeSetName(ReducerEventContext ctx, Reducer.SetName args)
{
if (OnSetName == null)
{
if (InternalOnUnhandledReducerError != null)
{
switch (ctx.Event.Status)
{
case Status.Failed(var reason): InternalOnUnhandledReducerError(ctx, new Exception(reason)); break;
case Status.OutOfEnergy(var _): InternalOnUnhandledReducerError(ctx, new Exception("out of energy")); break;
}
}
return false;
}
OnSetName(
ctx,
args.Name
);
return true;
}
}
public abstract partial class Reducer
{
[SpacetimeDB.Type]
[DataContract]
public sealed partial class SetName : Reducer, IReducerArgs
{
[DataMember(Name = "name")]
public string Name;
public SetName(string Name)
{
this.Name = Name;
}
public SetName()
{
this.Name = "";
}
string IReducerArgs.ReducerName => "SetName";
}
}
public sealed partial class SetReducerFlags
{
internal CallReducerFlags SetNameFlags;
public void SetName(CallReducerFlags flags) => SetNameFlags = flags;
}
}