public ModelProperty( IStorage storage, BotStateSet botStateSet, TSet defaultValue, string name) { var state = new NamedState(storage, name); accessor = state.CreateProperty <TSet>(name); botStateSet.Add(state); var current = state.Load().Result; if (current == null || !current.ContainsKey(name)) { var get = Convert(defaultValue); lock (this) { tget = get; } } else { var get = Convert((TSet)current[name]); lock (this) { tget = get; } } }
public GalaxyGameObjectState(Sprite icon, long id, FactoryStamp stamp, NamedState namedState, AppearablePositionState positionState, FactionOwnedState factionOwnedState, StateActionState actionState) { this.icon = icon; this.id = id; this.stamp = stamp; this.namedState = namedState; this.positionState = positionState; this.stateActionState = actionState; this.factionOwnedState = factionOwnedState; }
string ICssBundle.RenderNamed(string name) { NamedState state = namedState[name]; if (state.Debug) { return(debugCssFiles[name]); } return(RenderRelease(name, state.RenderTo, new FileRenderer(fileWriterFactory))); }
string IJavaScriptBundle.RenderNamed(string name) { NamedState state = namedState[name]; if (state.Debug) { return(debugJavaScriptFiles[name]); } string outputFile = ResolveAppRelativePathToFileSystem(state.RenderTo); return(RenderRelease(name, state.RenderTo, new FileRenderer(fileWriterFactory))); }
public FleetState(ShipsContainer ships, Sprite icon, long id, FactoryStamp stamp, NamedState namedState, FactionOwnedState factionOwnedState, AppearablePositionState positionState, StateActionState actionState) : base(icon, id, stamp, namedState, positionState, factionOwnedState, actionState) { this.shipsContainer = ships; }
public PlanetState(FactionOwnedState factionState, TileableState tileableState, Sprite icon, long id, FactoryStamp stamp, NamedState namedState, AppearablePositionState positionState, StateActionState actionState) : base(icon, id, stamp, namedState, positionState, factionState, actionState) { this.tileableState = tileableState; }
void ICssBundleBuilder.AsNamed(string name, string renderTo) { namedState[name] = new NamedState(debugStatusReader.IsDebuggingEnabled(), renderTo); Render(renderTo, name); }
public void AsNamed(string name, string renderTo) { namedState[name] = new NamedState(debugStatusReader.IsDebuggingEnabled(), renderTo); Render(renderTo, name); }
public StarNodeState(StarAsContainerState asContainerState, Sprite icon, long id, FactoryStamp stamp, NamedState namedState, AppearablePositionState positionState, FactionOwnedState factionOwned, StateActionState actionState) : base(icon, id, stamp, namedState, positionState, factionOwned, actionState) { this.asContainerState = asContainerState; }