60 if (itemData !=
null) {
67 if (blockData !=
null) {
74 public override void OnBlockRemoved(
int value,
int newValue,
int x,
int y,
int z) {
79 Point3 point =
new(x, y, z);
86 Point3 point =
new(x, y, z);
93 base.Load(valuesDictionary);
95 foreach (KeyValuePair<string, object> item
in valuesDictionary.GetValue<
ValuesDictionary>(
"Blocks")) {
97 value.LoadString((
string)item.Value);
99 if (exception ==
null) {
107 foreach (KeyValuePair<string, object> item2
in valuesDictionary.GetValue<
ValuesDictionary>(
"Items")) {
110 value2.LoadString((
string)item2.Value);
117 base.Save(valuesDictionary);
119 valuesDictionary.SetValue(
"Blocks", valuesDictionary2);
120 foreach (KeyValuePair<Point3, T> blocksDatum
in m_blocksData) {
124 valuesDictionary2.SetValue(movingBlocksDatum.Key.ToString(), movingBlocksDatum.Value.SaveString());
127 valuesDictionary.SetValue(
"Items", valuesDictionary3);
128 foreach (KeyValuePair<int, T> itemsDatum
in m_itemsData) {
134 for (
int i = 1; i < 1000; i++) {
143 HashSet<int> hashSet =
new();
149 List<int> list =
new();
150 foreach (KeyValuePair<int, T> itemsDatum
in m_itemsData) {
151 if (!hashSet.Contains(itemsDatum.Key)) {
152 list.Add(itemsDatum.Key);
155 foreach (
int item2
in list) {
static string ConvertToString(object value)
static object ConvertFromString(Type type, string data)
static MovingBlock LoadFromString(Project project, string movingBlockInfo, out Exception exception)
override void OnBlockStartMoving(int value, int newValue, int x, int y, int z, MovingBlock movingBlock)
override void Load(ValuesDictionary valuesDictionary)
Dictionary< Point3, T > m_blocksData
SubsystemItemsScanner m_subsystemItemsScanner
void GarbageCollectItems(ReadOnlyList< ScannedItemData > allExistingItems)
Dictionary< MovingBlock, T > m_movingBlocksData
Dictionary< int, T > m_itemsData
override void OnItemHarvested(int x, int y, int z, int blockValue, ref BlockDropValue dropValue, ref int newBlockValue)
override void OnItemPlaced(int x, int y, int z, ref BlockPlacementData placementData, int itemValue)
override void OnBlockRemoved(int value, int newValue, int x, int y, int z)
void SetBlockData(MovingBlock movingBlock, T t)
SubsystemEditableItemBehavior(int contents)
int StoreItemDataAtUniqueId(T t)
override void OnBlockStopMoving(int value, int oldValue, int x, int y, int z, MovingBlock movingBlock)
T GetBlockData(Point3 point)
T GetBlockData(MovingBlock movingBlock)
void SetBlockData(Point3 point, T t)
override void Save(ValuesDictionary valuesDictionary)
static int ExtractContents(int value)
static int ReplaceData(int value, int data)
static int ExtractData(int value)
ValuesDictionary ValuesDictionary