-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorldData.cs
More file actions
68 lines (57 loc) · 1.32 KB
/
WorldData.cs
File metadata and controls
68 lines (57 loc) · 1.32 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
using System.Collections.Generic;
using InventorySystem.Items;
using UnityEngine;
namespace Causality0.Core;
public enum PickupAct : byte
{
Add,
Move,
Remove
}
public struct PickupData
{
public int Id;
public ushort T;
public Vector3 Pos;
public Quaternion Rot;
public uint At;
public ushort Am;
public bool Locked;
public PickupData(int id, ItemType t, Vector3 pos, Quaternion rot, uint at, ushort am, bool locked)
{
Id = id;
T = (ushort)t;
Pos = pos;
Rot = rot;
At = at;
Am = am;
Locked = locked;
}
public ItemType ItemType => (ItemType)T;
}
public struct PickupOp
{
public float Ts;
public PickupAct Act;
public int Id;
public PickupData Data;
public PickupOp(float ts, PickupAct act, int id, PickupData data)
{
Ts = ts;
Act = act;
Id = id;
Data = data;
}
public static PickupOp NewAdd(float ts, PickupData data)
{
return new PickupOp(ts, PickupAct.Add, data.Id, data);
}
public static PickupOp NewMove(float ts, PickupData data)
{
return new PickupOp(ts, PickupAct.Move, data.Id, data);
}
public static PickupOp NewRemove(float ts, int id)
{
return new PickupOp(ts, PickupAct.Remove, id, default);
}
}