Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
WorkSession.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using System.Runtime.Serialization;
3using Newtonsoft.Json;
4
5public class WorkSession : EClass
6{
7 [JsonProperty]
8 public List<WorkOutcome> outcomes;
9
10 [JsonProperty]
11 public int[] ints = new int[5];
12
14
15 public int id
16 {
17 get
18 {
19 return ints[1];
20 }
21 set
22 {
23 ints[1] = value;
24 }
25 }
26
27 public int efficiency
28 {
29 get
30 {
31 return ints[2];
32 }
33 set
34 {
35 ints[2] = value;
36 }
37 }
38
39 [OnSerializing]
40 private void _OnSerializing(StreamingContext context)
41 {
42 ints[0] = _bits.ToInt();
43 }
44
45 [OnDeserialized]
46 private void _OnDeserialized(StreamingContext context)
47 {
48 _bits.SetInt(ints[0]);
49 }
50
51 public void AddOutcome(WorkOutcome o)
52 {
53 if (outcomes == null)
54 {
55 outcomes = new List<WorkOutcome>();
56 }
57 outcomes.Add(o);
58 }
59}
Definition: EClass.cs:5
void _OnSerializing(StreamingContext context)
Definition: WorkSession.cs:40
int efficiency
Definition: WorkSession.cs:28
BitArray32 _bits
Definition: WorkSession.cs:13
int[] ints
Definition: WorkSession.cs:11
void AddOutcome(WorkOutcome o)
Definition: WorkSession.cs:51
void _OnDeserialized(StreamingContext context)
Definition: WorkSession.cs:46
List< WorkOutcome > outcomes
Definition: WorkSession.cs:8
void SetInt(int i)
Definition: BitArray32.cs:89
int ToInt()
Definition: BitArray32.cs:84