/// <summary> /// Initializes a new instance of the <see cref="AssemblyCSharp.Scripts.EntLogic.SerializationObjects.Assignment"/> class. /// </summary> public Assignment() { VariableSignature signature = RegistrationManager.SelectReadWriteVariableAtRandom(); this.readWriteVariable = new ReadWriteVariable(signature); this.rightStatement = new RightStatement(signature.VariableType); }
/// <summary> /// Initializes a new instance of the <see cref="AssemblyCSharp.Scripts.EntLogic.SerializationObjects.Assignment"/> class. /// </summary> /// <param name="reader">Reader.</param> public Assignment(FileIOManager reader) { string nextLine = reader.ReadNextContentLineAndTrim(); if (CommonHelperMethods.StringStartsWith(nextLine, ReadWriteVariable.Name)) { this.readWriteVariable = new ReadWriteVariable(reader); } else { CommonHelperMethods.ThrowStatementParseException( nextLine, reader, ReadWriteVariable.Name); } nextLine = reader.ReadNextContentLineAndTrim(); if (CommonHelperMethods.StringStartsWith(nextLine, RightStatement.Name)) { this.rightStatement = new RightStatement(reader); } else { CommonHelperMethods.ThrowStatementParseException( nextLine, reader, RightStatement.Name); } }
/// <summary> /// Will possibly mutate this section of logic. /// </summary> public void PossiblyMutate() { if (GeneticLogicRoot.RollMutateDice()) { VariableSignature signature = RegistrationManager.SelectReadWriteVariableAtRandom(); this.readWriteVariable = new ReadWriteVariable(signature); this.rightStatement = new RightStatement(signature.VariableType); return; } if (this.rightStatement != null) { this.rightStatement.PossiblyMutate(); } }