SimAntics: Implement Semi-Attribute set

This commit is contained in:
Nahuel Rocchetti 2024-07-09 20:17:24 -03:00
parent dab570aef4
commit 844bb342a9

View file

@ -62,6 +62,9 @@ namespace OpenTS2.SimAntics
case VMDataSource.MyObjectsAttributes:
Entity.Attributes[dataIndex] = value;
return;
case VMDataSource.MyObjectsSemiAttributes:
Entity.SemiAttributes[dataIndex] = value;
return;
case VMDataSource.MyObject:
Entity.ObjectData[dataIndex] = value;
return;
@ -89,6 +92,12 @@ namespace OpenTS2.SimAntics
case VMDataSource.StackObjectsAttributes:
StackObjectEntity.Attributes[dataIndex] = value;
return;
case VMDataSource.StackObjectsSemiAttributes:
StackObjectEntity.SemiAttributes[dataIndex] = value;
return;
case VMDataSource.StackObjectsSemiAttributeByParam:
StackObjectEntity.SemiAttributes[StackFrame.Arguments[dataIndex]] = value;
return;
}
throw new SimAnticsException($"Attempted to modify a variable from an out of range data source ({source}[{dataIndex}]).", StackFrame);
}