Beispiel #1
0
 /// <summary>
 /// Creates an empty Event with the given values.
 /// </summary>
 public Event(long id = 0, RestBehaviorType restBehavior = RestBehaviorType.Default)
 {
     ID           = id;
     Instructions = new List <Instruction>();
     Parameters   = new List <Parameter>();
     RestBehavior = restBehavior;
 }
Beispiel #2
0
 /// <summary>
 /// Creates a new empty event with specified ID and rest behavior.
 /// </summary>
 public Event(long id, RestBehaviorType restBehavior)
 {
     ID           = id;
     RestBehavior = restBehavior;
     Instructions = new List <Instruction>();
     Parameters   = new List <Parameter>();
 }
Beispiel #3
0
            internal Event(BinaryReaderEx br, Game format, Offsets offsets)
            {
                ID = br.ReadVarint();
                long instructionCount   = br.ReadVarint();
                long instructionsOffset = br.ReadVarint();
                long parameterCount     = br.ReadVarint();
                long parametersOffset   = br.ReadVarint();

                RestBehavior = br.ReadEnum32 <RestBehaviorType>();
                br.AssertInt32(0);

                Instructions = new List <Instruction>((int)instructionCount);
                if (instructionCount > 0)
                {
                    br.StepIn(offsets.Instructions + instructionsOffset);
                    {
                        for (int i = 0; i < instructionCount; i++)
                        {
                            Instructions.Add(new Instruction(br, format, offsets));
                        }
                    }
                    br.StepOut();
                }

                Parameters = new List <Parameter>((int)parameterCount);
                if (parameterCount > 0)
                {
                    br.StepIn(offsets.Parameters + parametersOffset);
                    {
                        for (int i = 0; i < parameterCount; i++)
                        {
                            Parameters.Add(new Parameter(br, format));
                        }
                    }
                    br.StepOut();
                }
            }