public void SaveState(StateHolder st) { st.Rectangle1_Enabled = _Enabled; st.Rectangle1_Volume = _Volume; st.Rectangle1_Envelope = _Envelope; st.Rectangle1_Frequency = _Frequency; st.Rectangle1_SampleCount = _SampleCount; st.Rectangle1_RenderedLength = _RenderedLength; st.Rectangle1_DutyCycle = _DutyCycle; st.Rectangle1_FreqTimer = _FreqTimer; st.Rectangle1_DecayCount = _DecayCount; st.Rectangle1_DecayTimer = _DecayTimer; st.Rectangle1_DecayDiable = _DecayDiable; st.Rectangle1_DecayReset = _DecayReset; st.Rectangle1_DecayLoopEnable = _DecayLoopEnable; st.Rectangle1_LengthCount = _LengthCount; st.Rectangle1_SweepShift = _SweepShift; st.Rectangle1_SweepDirection = _SweepDirection; st.Rectangle1_SweepRate = _SweepRate; st.Rectangle1_SweepEnable = _SweepEnable; st.Rectangle1_SweepCount = _SweepCount; st.Rectangle1_SweepReset = _SweepReset; st.Rectangle1_SweepForceSilence = _SweepForceSilence; st.Rectangle1DutyPercentage = DutyPercentage; st.Rectangle1WaveStatus = WaveStatus; }
//[DebuggerStepThrough] ////[DebuggerHidden] public object NewInstance(CompositeInstance compositeInstance, StateHolder stateHolder, UsesInstance uses) { var injectionContext = new InjectionContext(compositeInstance, uses, stateHolder); object mixin = this.injectedObjectBuilder.NewInstance(injectionContext); return(mixin); }
/// <summary> /// Closes the transaction and releases unmanaged resources. /// </summary> private void Close() { lock (this) { _state = _state ?? new StateHolder((TransactionState)_txs.TxClose(this)); } }
public void LoadState(StateHolder st) { _Enabled = st.Rectangle1_Enabled; _Volume = st.Rectangle1_Volume; _Envelope = st.Rectangle1_Envelope; _Frequency = st.Rectangle1_Frequency; _SampleCount = st.Rectangle1_SampleCount; _RenderedLength = st.Rectangle1_RenderedLength; _DutyCycle = st.Rectangle1_DutyCycle; _FreqTimer = st.Rectangle1_FreqTimer; _DecayCount = st.Rectangle1_DecayCount; _DecayTimer = st.Rectangle1_DecayTimer; _DecayDiable = st.Rectangle1_DecayDiable; _DecayReset = st.Rectangle1_DecayReset; _DecayLoopEnable = st.Rectangle1_DecayLoopEnable; _LengthCount = st.Rectangle1_LengthCount; _SweepShift = st.Rectangle1_SweepShift; _SweepDirection = st.Rectangle1_SweepDirection; _SweepRate = st.Rectangle1_SweepRate; _SweepEnable = st.Rectangle1_SweepEnable; _SweepCount = st.Rectangle1_SweepCount; _SweepReset = st.Rectangle1_SweepReset; _SweepForceSilence = st.Rectangle1_SweepForceSilence; DutyPercentage = st.Rectangle1DutyPercentage; WaveStatus = st.Rectangle1WaveStatus; }
private void Awake() { player = FindObjectOfType <Player>(); tilesContainer = FindObjectOfType <TilesContainer>(); stateHolder = FindObjectOfType <StateHolder>(); diceUI = FindObjectOfType <DiceUI>(); }
public void StateHolder_Operator_1() { int value1 = 10; StateHolder <int> holder = value1; int value2 = holder; Assert.AreEqual(value1, value2); }
// Use this for initialization void Start() { stateHolder = GetComponent <StateHolder>(); timer = 0f; isLoading = false; isShooting = false; }
//[DebuggerStepThrough] ////[DebuggerHidden] protected AbstractCompositeInstance(AbstractCompositeModel compositeModel, ModuleInstance moduleInstance, object[] mixins, StateHolder state) { this.CompositeModel = compositeModel; this.ModuleInstance = moduleInstance; this.Mixins = mixins; this.State = state; this.Proxy = compositeModel.NewProxy(this); }
void Start() { this.WeaponLogic = GetComponent <WeaponLogic>(); this.mov = GetComponent <MovimientoController>(); this.totemController = GetComponent <Totem>(); initLine(); this.stateHolder = GameObject.FindGameObjectWithTag("GameController").GetComponent <StateHolder>(); }
public CompositeInstance NewValueInstance(ModuleInstance moduleInstance, UsesInstance uses, StateHolder stateHolder) { object[] mixins = this.mixinsModel.NewMixinHolder(); CompositeInstance compositeInstance = new ValueInstance(this, moduleInstance, mixins, stateHolder); ((MixinsModel)this.mixinsModel).NewMixins(compositeInstance, uses, stateHolder, mixins); return compositeInstance; }
public override bool Validate(ValidateCallback callback, StateHolder state) { if (callback == null) { throw new ArgumentNullException("callback"); } if (sourceLocationId <= 0) { if (!callback(Translator.GetString("Source location cannot be empty!"), ErrorSeverity.Error, (int)ErrorCodes.SourceLocationEmpty, state)) { return(false); } } if (BusinessDomain.LoggedUser.LockedLocationId > 0 && BusinessDomain.LoggedUser.LockedLocationId != sourceLocationId) { if (!callback(Translator.GetString("The source location cannot be used!"), ErrorSeverity.Error, (int)ErrorCodes.SourceLocationCannotBeUsed, state)) { return(false); } } string error; string warning; if (!BusinessDomain.CanUseLocationInOperation(OperationType, sourceLocationId, out error, out warning)) { if (error != null && !callback(error, ErrorSeverity.Error, (int)ErrorCodes.SourceLocationCannotBeUsed, state)) { return(false); } if (warning != null && !callback(error, ErrorSeverity.Warning, (int)ErrorCodes.SourceLocationCannotBeUsed, state)) { return(false); } } if (targetLocationId <= 0) { if (!callback(Translator.GetString("Target location cannot be empty!"), ErrorSeverity.Error, (int)ErrorCodes.TargetLocationEmpty, state)) { return(false); } } if (details.Any(d => d.Quantity.IsZero())) { if (!callback(Translator.GetString("Details contain zero quantities!"), ErrorSeverity.Error, (int)ErrorCodes.TargetLocationEmpty, state)) { return(false); } } return(true); }
// For mixins //[DebuggerStepThrough] ////[DebuggerHidden] public InjectionContext(CompositeInstance compositeInstance, UsesInstance uses, StateHolder state) { this.CompositeInstance = compositeInstance; this.ModuleInstance = compositeInstance.ModuleInstance; this.Uses = uses; this.State = state; this.Next = null; this.ProxyHandler = null; }
//[DebuggerStepThrough] ////[DebuggerHidden] public void NewMixins(CompositeInstance compositeInstance, UsesInstance uses, StateHolder stateHolder, object[] mixins) { int i = 0; foreach (MixinModel mixinModel in this.mixinModels) { object mixin = mixinModel.NewInstance(compositeInstance, stateHolder, uses); mixins[i++] = mixin; } }
protected override async ValueTask OnClosed(DisconnectedReason reason) { StateHolder state = _state !; await Task.WhenAll(state.Input.CloseAsync(), state.OutputPump.CloseAsync()); await base.OnClosed(reason); _state = null; }
public void StateHolder_Event_2() { StateHolder <string> holder = new StateHolder <string>(); bool flag = false; holder.ValueChanged += (sender, args) => { flag = true; }; holder.Value = "World"; Assert.IsTrue(flag); }
/// <summary> /// Rolls this tx back and closes it. /// </summary> public void Rollback() { lock (this) { ThrowIfClosed(); _state = new StateHolder(_txs.TxRollback(this)); } }
public void StateHolder_ToString_1() { StateHolder <string> holder = new StateHolder <string>(); Assert.AreEqual("(null)", holder.ToString()); holder = "Hello"; Assert.AreEqual("Hello", holder.ToString()); }
public void StateHolder_Value_1() { StateHolder <int> holder = 10; Assert.AreEqual(10, holder.Value); holder.Value = 100; Assert.AreEqual(100, holder.Value); }
/// <summary> /// Commits this tx and closes it. /// </summary> public void Commit() { lock (this) { ThrowIfClosed(); _state = new StateHolder(_txs.TxCommit(this)); } }
public void StateHolder_Event_1() { StateHolder <int> holder = 10; bool flag = false; holder.ValueChanged += (sender, args) => { flag = true; }; holder.Value = 100; Assert.IsTrue(flag); }
// Use this for initialization void Start() { this.stateHolder = GetComponent <StateHolder>(); initPlayers(); estadoPartida = PARTIDA_STATE.INICIO_RONDA; turnoJugador = TURNO_JUGADOR.PRIMER_JUGADOR; GameObject inventarioGameObject = GameObject.FindGameObjectWithTag("MainInventory"); this.inventario = inventarioGameObject.GetComponent <Inventory>(); GameObject hotbarGameObject = GameObject.FindGameObjectWithTag("Hotbar"); this.hotbar = hotbarGameObject.GetComponent <Inventory>(); gestorInventario = this.gameObject.AddComponent <GestionInventario>(); gestorInventario.inventory = inventarioGameObject; gestorHotbar = this.gameObject.AddComponent <GestionHotbar>(); gestorHotbar.inventory = hotbarGameObject; condicionFinJuego = GetComponent <EndGameCondition>(); gameObject.AddComponent <PlatformSpawner> (); //txtTurnoJugador.text = "Turno: " + turnoJugador.ToString(); ronda = 0; turnCounter = 1; numCajasLanzadas = 1; this.listaItemsPrimerJugador = new List <int>(); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoAngel); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoEscudoDoble); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoEscudoSimple); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoIglu); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoBomb); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoGrenade); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoSemtex); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoMissile); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoBomb); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoGrenade); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoSemtex); listaItemsPrimerJugador.Add(Global.TIPO_OBJETOS.objetoMissile); this.listaItemsSegundoJugador = new List <int>(); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoAngel); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoEscudoDoble); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoEscudoSimple); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoIglu); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoBomb); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoGrenade); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoSemtex); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoMissile); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoBomb); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoGrenade); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoSemtex); listaItemsSegundoJugador.Add(Global.TIPO_OBJETOS.objetoMissile); }
public T NewInstance() { StateHolder instanceState = this.state == null?this.transientModel.NewInitialState() : this.transientModel.NewState(this.state); this.transientModel.State.CheckConstraints(instanceState); CompositeInstance compositeInstance = this.transientModel.NewCompositeInstance(this.moduleInstance, this.uses ?? UsesInstance.NoUses, instanceState); return((T)compositeInstance.Proxy); }
// Use this for initialization void Start() { speedModifier = 1f; mover = Vector3.zero; rotator = Vector3.zero; movementCollider = GetComponent <Collider>(); movementRigidbody = GetComponent <Rigidbody>(); stateHolder = GetComponent <StateHolder>(); }
private void ApplyControllerVersions(StateHolder state) { var controllerVersions = _versions.Where(x => x >= state.ControllerIntroduced.Version); if (state.IsControllerMarkedAsRemoved) { controllerVersions = controllerVersions.Where(x => x < state.ControllerRemoved.Version); } state.Controller.HasApiVersions(controllerVersions.ToArray()); }
public bool Validate(ValidateCallback callback, StateHolder state) { if (callback == null) { throw new ArgumentNullException("callback"); } if (name.Length == 0) { if (!callback(Translator.GetString("User name cannot be empty!"), ErrorSeverity.Error, 0, state)) { return(false); } } User u = GetByName(name); if (u != null && u.Id != id) { if (!callback(string.Format(Translator.GetString("User with the name \"{0}\" already exists! Do you want to save the user anyway?"), name), ErrorSeverity.Warning, 1, state)) { return(false); } } if (!string.IsNullOrEmpty(code)) { u = GetByCode(code); if (u != null && u.Id != id) { if (!callback(string.Format(Translator.GetString("User with the code \"{0}\" already exists. Do you want to save the user anyway?"), code), ErrorSeverity.Warning, 2, state)) { return(false); } } } if (!string.IsNullOrEmpty(cardNo)) { u = GetByCard(cardNo); if (u != null && u.Id != id) { if (!callback(string.Format(Translator.GetString("User with the card \"{0}\" already exists. Do you want to save the user anyway?"), cardNo), ErrorSeverity.Warning, 3, state)) { return(false); } } } return(true); }
public void SaveState(StateHolder st) { st.VRC6SawtoothAccumRate = AccumRate; st.VRC6SawtoothAccumStep = AccumStep; st.VRC6SawtoothAccum = Accum; st.VRC6Sawtooth_FreqTimer = _FreqTimer; st.VRC6Sawtooth_Enabled = _Enabled; st.VRC6Sawtooth_Frequency = _Frequency; st.VRC6Sawtooth_SampleCount = _SampleCount; st.VRC6Sawtooth_RenderedLength = _RenderedLength; st.VRC6SawtoothOUT = OUT; }
public override void Activate() { FindObjectOfType <EventTextBox>().Close(); StateHolder stateHolder = FindObjectOfType <StateHolder>(); stateHolder.SetPhaseToCombat(); CombatManager combatManager = FindObjectOfType <CombatManager>(); combatManager.StartCoroutine(combatManager.InitializeCombat()); }
public void LoadState(StateHolder st) { AccumRate = st.VRC6SawtoothAccumRate; AccumStep = st.VRC6SawtoothAccumStep; Accum = st.VRC6SawtoothAccum; _FreqTimer = st.VRC6Sawtooth_FreqTimer; _Enabled = st.VRC6Sawtooth_Enabled; _Frequency = st.VRC6Sawtooth_Frequency; _SampleCount = st.VRC6Sawtooth_SampleCount; _RenderedLength = st.VRC6Sawtooth_RenderedLength; OUT = st.VRC6SawtoothOUT; }
public void SaveState(StateHolder st) { st.VRC6Pulse2_Volume = _Volume; st.VRC6Pulse2DutyPercentage = DutyPercentage; st.VRC6Pulse2_DutyCycle = _DutyCycle; st.VRC6Pulse2_FreqTimer = _FreqTimer; st.VRC6Pulse2_Enabled = _Enabled; st.VRC6Pulse2_Frequency = _Frequency; st.VRC6Pulse2_SampleCount = _SampleCount; st.VRC6Pulse2_RenderedLength = _RenderedLength; st.VRC6Pulse2WaveStatus = WaveStatus; st.VRC6Pulse2OUT = OUT; }
public void LoadState(StateHolder st) { _Volume = st.VRC6Pulse2_Volume; DutyPercentage = st.VRC6Pulse2DutyPercentage; _DutyCycle = st.VRC6Pulse2_DutyCycle; _FreqTimer = st.VRC6Pulse2_FreqTimer; _Enabled = st.VRC6Pulse2_Enabled; _Frequency = st.VRC6Pulse2_Frequency; _SampleCount = st.VRC6Pulse2_SampleCount; _RenderedLength = st.VRC6Pulse2_RenderedLength; WaveStatus = st.VRC6Pulse2WaveStatus; OUT = st.VRC6Pulse2OUT; }
public override IState <PlAYER_STATE> HandleState(StateHolder <PlAYER_STATE> holder, IState <PlAYER_STATE> state) { switch (state.GetState()) { case PlAYER_STATE.MOVE: case PlAYER_STATE.ATTACKED: case PlAYER_STATE.ATTACK_AFTER: case PlAYER_STATE.ATTACK_BEFORE: case PlAYER_STATE.DEAD: return(state); } return(null); }
public bool Apply(IControllerConventionBuilder controller, HttpControllerDescriptor controllerDescriptor) { var state = new StateHolder(controller, controllerDescriptor); if (!state.IsValid) { return(false); } ApplyControllerVersions(state); ApplyControllerActionVersions(state); return(true); }
// Update is called once per frame void Update() { AudioListener.GetOutputData(waveData, 1); volume /= 2.0f; volume += waveData.Select(x => x * x).Sum() / waveData.Length * 0.5f; var y = Mathf.Sin(StateHolder.GetRhythm() / 10.0f * Mathf.PI * 2.0f) * 0.3f; for (int i = 0; i < childCount; i++) { this.transform.GetChild(i).transform.position = childTransform[i].position + new Vector3(0.0f, y, 0.0f); this.transform.GetChild(i).transform.localScale = childTransform[i].scale * (1.0f + volume * 10.0f); this.transform.GetChild(i).transform.Rotate(Vector3.up * Time.deltaTime * 30.0f, Space.World); } }
public void Dispose() { try { Close(); } catch (IgniteIllegalStateException) { _state = new StateHolder(TransactionState.Unknown); } finally { GC.SuppressFinalize(this); } }
public StateHolder NewInstance(StateHolder state) { var properties = new Dictionary<PropertyInfo, Property>(); foreach (PropertyModel propertyModel in this.propertyModels) { Property originalProperty = state.GetProperty(propertyModel.PropertyInfo); object initialValue = originalProperty.Value; initialValue = CloneInitialValue(initialValue, false); // Create property instance Property property = propertyModel.NewInstance(initialValue); properties.Add(propertyModel.PropertyInfo, property); } return new PropertiesInstance(properties); }
private static void SetApplicationState(object value) { TimeSpan timeToLive = new TimeSpan(1, 0, 0); SortedList<string, object> list = GetApplicationList(); object objValue; StateHolder holder; if (list.TryGetValue(value.GetType().FullName, out objValue)) { holder = objValue as StateHolder; } else { holder = new StateHolder(); list[value.GetType().FullName] = holder; } holder.State = value; holder.LastAccess = DateTime.Now; holder.TimeToLive = timeToLive; }
public StateHolder NewState(StateHolder state) { return this.stateModel.NewState(state); }
public void CheckConstraints(StateHolder instanceState) { }
public TransientInstance(AbstractCompositeModel compositeModel, ModuleInstance moduleInstance, object[] mixins, StateHolder state) : base(compositeModel, moduleInstance, mixins, state) { }
public object NewInstance(CompositeInstance compositeInstance, StateHolder stateHolder) { return this.NewInstance(compositeInstance, stateHolder, UsesInstance.NoUses); }
//[DebuggerStepThrough] ////[DebuggerHidden] public object NewInstance(CompositeInstance compositeInstance, StateHolder stateHolder, UsesInstance uses) { var injectionContext = new InjectionContext(compositeInstance, uses, stateHolder); object mixin = this.injectedObjectBuilder.NewInstance(injectionContext); return mixin; }
public StateHolder NewState(StateHolder state) { return this.propertiesModel.NewInstance(state); }
public ValueInstance(ValueModel valueModel, ModuleInstance moduleInstance, object[] mixins, StateHolder state) : base(valueModel, moduleInstance, mixins, state) { }