示例#1
0
        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;
                }
            }
        }
示例#2
0
 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;
 }
示例#3
0
        string ICssBundle.RenderNamed(string name)
        {
            NamedState state = namedState[name];

            if (state.Debug)
            {
                return(debugCssFiles[name]);
            }
            return(RenderRelease(name, state.RenderTo, new FileRenderer(fileWriterFactory)));
        }
示例#4
0
        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)));
        }
示例#5
0
 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;
 }
示例#6
0
 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;
 }
示例#7
0
 void ICssBundleBuilder.AsNamed(string name, string renderTo)
 {
     namedState[name] = new NamedState(debugStatusReader.IsDebuggingEnabled(), renderTo);
     Render(renderTo, name);
 }
示例#8
0
 public void AsNamed(string name, string renderTo)
 {
     namedState[name] = new NamedState(debugStatusReader.IsDebuggingEnabled(), renderTo);
     Render(renderTo, name);
 }
示例#9
0
 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;
 }