@@ -3,7 +3,7 @@ use std::{cell::RefCell, rc::Rc};
33use strum_macros:: IntoStaticStr ;
44
55use super :: {
6- LogicVM , VMLoadError , VMLoadResult ,
6+ LogicVMBuilder , VMLoadError , VMLoadResult ,
77 processor:: { Processor , ProcessorBuilder , ProcessorState } ,
88} ;
99use crate :: types:: {
@@ -52,15 +52,15 @@ impl Building {
5252 name : & str ,
5353 position : Point2 ,
5454 config : & Object ,
55- vm : & LogicVM ,
55+ builder : & LogicVMBuilder ,
5656 ) -> VMLoadResult < Self > {
5757 let data = match name {
5858 MICRO_PROCESSOR | LOGIC_PROCESSOR | HYPER_PROCESSOR | WORLD_PROCESSOR => {
5959 return Self :: from_processor_config (
6060 name,
6161 position,
6262 & ProcessorBuilder :: parse_config ( config) ?,
63- vm ,
63+ builder ,
6464 ) ;
6565 }
6666
@@ -103,17 +103,15 @@ impl Building {
103103 name : & str ,
104104 position : Point2 ,
105105 config : & ProcessorConfig ,
106- vm : & LogicVM ,
106+ builder : & LogicVMBuilder ,
107107 ) -> VMLoadResult < Self > {
108108 let data = match name {
109109 MICRO_PROCESSOR => BuildingData :: Processor (
110110 ProcessorBuilder {
111111 ipt : 2 ,
112- range : 8. * 10. ,
113112 privileged : false ,
114- running_processors : Rc :: clone ( & vm. running_processors ) ,
115- time : Rc :: clone ( & vm. time ) ,
116- globals : & vm. globals ,
113+ running_processors : Rc :: clone ( & builder. vm . running_processors ) ,
114+ time : Rc :: clone ( & builder. vm . time ) ,
117115 position,
118116 config,
119117 }
@@ -122,11 +120,9 @@ impl Building {
122120 LOGIC_PROCESSOR => BuildingData :: Processor (
123121 ProcessorBuilder {
124122 ipt : 8 ,
125- range : 8. * 22. ,
126123 privileged : false ,
127- running_processors : Rc :: clone ( & vm. running_processors ) ,
128- time : Rc :: clone ( & vm. time ) ,
129- globals : & vm. globals ,
124+ running_processors : Rc :: clone ( & builder. vm . running_processors ) ,
125+ time : Rc :: clone ( & builder. vm . time ) ,
130126 position,
131127 config,
132128 }
@@ -135,11 +131,9 @@ impl Building {
135131 HYPER_PROCESSOR => BuildingData :: Processor (
136132 ProcessorBuilder {
137133 ipt : 25 ,
138- range : 8. * 42. ,
139134 privileged : false ,
140- running_processors : Rc :: clone ( & vm. running_processors ) ,
141- time : Rc :: clone ( & vm. time ) ,
142- globals : & vm. globals ,
135+ running_processors : Rc :: clone ( & builder. vm . running_processors ) ,
136+ time : Rc :: clone ( & builder. vm . time ) ,
143137 position,
144138 config,
145139 }
@@ -148,11 +142,9 @@ impl Building {
148142 WORLD_PROCESSOR => BuildingData :: Processor (
149143 ProcessorBuilder {
150144 ipt : 8 ,
151- range : f32:: MAX ,
152145 privileged : true ,
153- running_processors : Rc :: clone ( & vm. running_processors ) ,
154- time : Rc :: clone ( & vm. time ) ,
155- globals : & vm. globals ,
146+ running_processors : Rc :: clone ( & builder. vm . running_processors ) ,
147+ time : Rc :: clone ( & builder. vm . time ) ,
156148 position,
157149 config,
158150 }
@@ -176,9 +168,9 @@ impl Building {
176168 config,
177169 ..
178170 } : & SchematicTile ,
179- vm : & LogicVM ,
171+ builder : & LogicVMBuilder ,
180172 ) -> VMLoadResult < Self > {
181- Self :: from_config ( name, ( * position) . into ( ) , config, vm )
173+ Self :: from_config ( name, ( * position) . into ( ) , config, builder )
182174 }
183175}
184176
0 commit comments