2018-08-22 18:16:31 +00:00
|
|
|
import 'package:rules_of_living/src/Engine.dart';
|
|
|
|
|
|
|
|
class EngineService {
|
2018-08-27 18:50:12 +00:00
|
|
|
Engine _uncachedEngineAccess;
|
2018-08-25 07:33:15 +00:00
|
|
|
|
2018-08-27 18:50:12 +00:00
|
|
|
Engine get engine => _uncachedEngineAccess ?? _setCachedAndReturn(Engine());
|
|
|
|
void set engine(Engine newEngine) {
|
|
|
|
_uncachedEngineAccess = newEngine;
|
2018-08-25 07:33:15 +00:00
|
|
|
}
|
|
|
|
|
2018-08-27 18:50:12 +00:00
|
|
|
Engine _setCachedAndReturn(Engine newEngine) {
|
|
|
|
engine = newEngine;
|
|
|
|
return newEngine;
|
2018-08-25 07:33:15 +00:00
|
|
|
}
|
2018-08-22 18:16:31 +00:00
|
|
|
}
|