protected void btnDelete_Click1(object sender, EventArgs e) { if (GXGridView1.SelectedIndex != -1) { int stateID = 0; if (GXGridView1.SelectedDataKey != null) { int GXgvSelectedValue = Convert.ToInt32(GXGridView1.SelectedValue); stateID = GXgvSelectedValue; dvDataSource.SelectParameters.Clear(); dvDataSource.SelectParameters.Add("id", GXgvSelectedValue.ToString()); DetailsView1.DataBind(); } else { int GXgvSelectedValue = GXGridView1SelectedValue; stateID = GXgvSelectedValue; dvDataSource.SelectParameters.Clear(); dvDataSource.SelectParameters.Add("id", GXgvSelectedValue.ToString()); DetailsView1.DataBind(); } Broker.DataAccess.State s = Broker.DataAccess.State.Get(stateID); s.IsActive = false; Broker.DataAccess.State.Table.Context.SubmitChanges(); GXGridView1.TotalRecords = ActiveState.SelectCountCached(); GXGridView1.DataBind(); mvMain.SetActiveView(viewGrid); } }
public void GoToMenuState(ActiveState state) { updateFlipView = true; switch (state) { case ActiveState.Left: if (MenuState != MenuState.Right) { contentSelector.SelectedIndex = 0; } break; case ActiveState.Right: if (MenuState == MenuState.Right) { contentSelector.SelectedIndex = 1; } else if (MenuState == MenuState.Both) { contentSelector.SelectedIndex = 2; } break; default: break; } }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> // Called each frame. /// </summary> protected override void Update() { base.Update(); // object is active in the world if (_ObjectState == WorldObjectStates.Active && IsAlive()) { // Show the healthbar ///if (_HealthBar != null) { _HealthBar.gameObject.SetActive(true); } // Create a healthbar if the unit doesn't have one linked to it ///else { CreateHealthBar(this, _Player.PlayerCamera); } // Update current shield hitpoints based on the spire hitpoints float points = 0; for (int i = 0; i < Spires.Count; i++) { points += Spires[i].GetHitPoints(); } _ShieldPoints = points; } // Always show the active state mesh if (ActiveState != null) { ActiveState.SetActive(true); } }
public override int GetHashCode() { int hash = 1; if (UserId != 0) { hash ^= UserId.GetHashCode(); } if (AppointmentId != 0) { hash ^= AppointmentId.GetHashCode(); } if (ActiveState != 0) { hash ^= ActiveState.GetHashCode(); } hash ^= activeGates_.GetHashCode(); hash ^= finishGates_.GetHashCode(); if (CreateTime != 0L) { hash ^= CreateTime.GetHashCode(); } if (LastModifyTime != 0L) { hash ^= LastModifyTime.GetHashCode(); } return(hash); }
public void ChangeState(ActiveState state) { lock (this) { this.state = state; } }
void Start() { ourShip = this.gameObject; enemyBoatController = GetComponent <EnemyBoatController>(); angleBetweenShipAndWind = GetComponent <AngleBetweenShipAndWind>(); windArea = GameObject.Find("Wind Area").GetComponent <WindArea>(); corner0 = GameObject.Find("Corner 0"); corner1 = GameObject.Find("Corner 1"); corner2 = GameObject.Find("Corner 2"); corner3 = GameObject.Find("Corner 3"); minDistBetweenParallel = 10; maxDistBetweenParallel = 30; cannonsTimeOfNextFire = new float[6]; for (int i = 0; i < cannonsTimeOfNextFire.Length; i++) { cannonsTimeOfNextFire[i] = Time.time; } enemyBoatController.SailsDown(); changeDirectionTime = Time.time + RandomPeriodOfTime(); activeState = state_PlayerSearch; }
public void Kill() { State = ActiveState.Idle; Position = Vector2.Zero; Bounds.X = Position.X; Bounds.Y = Position.Y; }
/// <summary> /// Checks the current active state's transitions against the new behaviour state. /// Performs no checking if the new state and current ActiveState have the same ID. /// </summary> /// <param name="newBehaviourState"></param> private void HandleBehaviourChange(uint newBehaviourState) { DebugUtils.AssertNotNull(ActiveState); // If we have not changed state then just return. if (newBehaviourState == ActiveState.StateID) { return; } // Check the transitions of the current active state if (ActiveState.CheckTransitions(newBehaviourState)) { SetNewActiveState(newBehaviourState); } // Check the global states foreach (State state in GlobalStates) { if (state != ActiveState && state.StateID == newBehaviourState) { SetNewActiveState(newBehaviourState); break; } } // Check that we have indeed transitioned to our new state Debug.Assert(newBehaviourState == ActiveState.StateID); // The new state we have moved to should not be playing already Debug.Assert(ActiveState.Animation.IsPlaying == false); ActiveState.Animation.IsPlaying = true; }
public virtual void SetState(ActiveState state, Tween customTween = null, Action callback = null) { if (state.Equals(ActiveState.ENABLE)) { gameObject.SetActive(true); } var tweens = customTween != null ? new List <Tween> () { customTween } : state.Equals(ActiveState.ENABLE) ? EnableAnimation(1f, 1f) : DisableAnimation(1f); for (int i = 0; i < tweens.Count; i++) { if (i == tweens.Count - 1) { tweens[i].OnComplete(() => { callback?.Invoke(); if (state.Equals(ActiveState.DISABLE)) { gameObject.SetActive(false); } }); } tweens[i].Play(); } }
protected virtual void FixedUpdate() { if (ActiveState != null) { ActiveState.OnStateFixedUpdate(); } }
// Use this for initialization void Start() { _PGS = gameObject.GetComponent <ArcReactor_Launcher>(); _hm = Owner.GetComponent <HealthModule>(); if (Owner.GetComponent <WeaponModule>()) { _sbwm = Owner.GetComponent <WeaponModule>(); starship = false; starbase = true; } if (Owner.GetComponent <Stats>()) { _st = Owner.GetComponent <Stats>(); _as = Owner.GetComponent <ActiveState>(); starship = true; starbase = false; } if (gameObject.GetComponent <AudioSource>()) { _a = gameObject.GetComponent <AudioSource>(); _a.maxDistance = 1000; _a.spatialBlend = 0.8f; } }
public void FixedUpdateActiveState() { if (ActiveState != null) { ActiveState.FixedUpdate(); } }
//=------------------------------------------------------------------= //=------------------------------------------------------------------= //=------------------------------------------------------------------= //=------------------------------------------------------------------= // Public Methods/Properties/etc. //=------------------------------------------------------------------= //=------------------------------------------------------------------= //=------------------------------------------------------------------= //=------------------------------------------------------------------= //=------------------------------------------------------------------= // Constructor //=------------------------------------------------------------------= /// <summary> /// Intializes a new instance of our class /// </summary> /// public TaskFrame() : base() { this.Font = new Font(base.Font, FontStyle.Bold); this.ForeColor = colorDefaultForeground(); this.BackColor = colorDefaultBackground(); this.CaptionBlend = new BlendFill(BlendStyle.Horizontal, colorCaptionBlendStart(), colorCaptionBlendFinish()); // // Set up some reasonable defaults here for the properties. // this.m_collapseButtonVisible = true; // // Make sure we don't bother sending this to the HWND, since it // will never see/use it. // SetStyle(ControlStyles.CacheText, true); // // Setting up our initial collapse/expand state. // this.m_activeState = ActiveState.Expanded; this.m_invisibleFromCollapse = false; // // misc goo // this.m_imageTransparentColor = Color.Transparent; }
private void refresh05() { //Refresh subscription status try { //Create reporting service web client proxy ReportingService rs = new ReportingService(); rs.Credentials = System.Net.CredentialCache.DefaultCredentials; //Request all subscriptions for the specified report this.mSubs05.Clear(); Subscription[] subscriptions = rs.ListSubscriptions(this.mReportName, null); if (subscriptions != null) { //Enumerate all subscriptions for (int i = 0; i < subscriptions.Length; i++) { //Get subscription properties Subscription sub = subscriptions[i]; ExtensionSettings extSettings = null; ActiveState active = null; string desc = "", status = "", eventType = "", matchData = ""; ParameterValue[] paramValues = null; rs.GetSubscriptionProperties(subscriptions[i].SubscriptionID, out extSettings, out desc, out active, out status, out eventType, out matchData, out paramValues); if (paramValues != null) { this.mSubs05.SubscriptionTable.AddSubscriptionTableRow(false, sub.Report, sub.SubscriptionID, desc, eventType, sub.LastExecuted, status, active.ToString(), getExtSettings(extSettings), matchData, getParamValues(paramValues), getSubjectLine(extSettings)); } } this.mSubs05.AcceptChanges(); } } catch (ApplicationException ex) { throw ex; } catch (Exception ex) { throw new ApplicationException("Failed to refresh subscriptions.", ex); } }
public ShoppingCart <TItem> Add(TItem item) { TItem[] newItems = new[] { item }; var newState = new ActiveState(newItems); return(FromState(newState)); }
private void SubscribeActiveStateEvents() { ActiveState.MessageGenerated += MessageGeneratedEvent; ActiveState.StateIsChanged += StateIsChanged; ActiveState.NonPriorityMessageGenerated += NonPriorityMessageGeneratedEvent; ActiveState.Init(); }
private void TryExitActiveState() { if (ActiveState.CanExit) { ActiveState.TryExitState(DeltaTime); //if is not in transition and is in the Main Tag try to Exit to lower States } }
void Start() { SelfDelay = Delay; _h = Owner.GetComponent <HealthModule>(); if (Owner.GetComponent <Stats>()) { _st = Owner.GetComponent <Stats>(); _as = Owner.GetComponent <ActiveState>(); _man = Owner.GetComponent <Maneuvers>(); IsShip = true; IsStation = false; } if (Owner.GetComponent <Station>()) { _sb = Owner.GetComponent <Station>(); _sbwm = Owner.GetComponent <WeaponModule>(); IsShip = false; IsStation = true; } moove = true; AllTorpedose = new GameObject[poolSize]; for (int i = 0; i < poolSize; i++) { AllTorpedose[i] = Instantiate(Shell) as GameObject; AllTorpedose[i].SetActive(false); } }
public void SetInactive() { if (this.activeState != ActiveState.Inactive) { this.activeState = ActiveState.Inactive; this.OnInactive(); } }
public CatBrain(CatAI cat) { this.cat = cat; this.currentActiveState = new RestingState(this.cat); this.physicalState = new CatPhysicalState(); this.mentalState = new MentalState(); this.eventQueue = new EventQueue(EVENT_UPDATE_INTERVAL); }
public CatBrain(CatAI cat, ActiveState initialActiveState) { this.cat = cat; this.currentActiveState = initialActiveState; this.physicalState = new CatPhysicalState(); this.mentalState = new MentalState(); this.eventQueue = new EventQueue(EVENT_UPDATE_INTERVAL); }
public void Add(TState state, Action enter, Action <float> update, Action exit) { if (_states.ContainsKey(state)) { throw new InvalidOperationException("State already is defined"); } _states[state] = new ActiveState(enter, update, exit); }
public void SetActive() { if (this.activeState != ActiveState.Active) { this.activeState = ActiveState.Active; this.OnActive(); } }
private void UpdateActiveState(BlockComponent blockComponent) { if (blockComponent != null) { //Debug.Log(blockComponent.name); currentState = (blockComponent.isMoving) ? ActiveState.Idle : ActiveState.Action; } }
void Start() { Camera = GameObject.FindGameObjectWithTag("MainCamera"); _GDB = GameObject.FindGameObjectWithTag("MainUI").GetComponent <GlobalDB>(); _GDB.dwarfList.Add(gameObject); _AS = gameObject.GetComponent <ActiveState>(); }
public Charge(String id, Texture2D spriteSheet, Vector2 position, List<Effect> effects, bool onStep, int[,] activePassability, int[,] inactivePassability, Condition passabilityCondition, float activeTime, float inactiveTime, float frameTime, float effectDelay) : base(id, spriteSheet, position, effects, onStep, activePassability, inactivePassability, passabilityCondition, activeTime, inactiveTime, inactiveTime / (spriteSheet.Width/Block.WIDTH), effectDelay) { state = new ActiveState(this); }
public async Task <T> SendMessageAsync <T>(TMessageId message, object arg = null) { if (ActiveState == null) { throw new InvalidOperationException("No active state to send message to."); } return(await ActiveState.SendMessageAsync <T>(this, message, arg)); }
public FiniteStateMachine(ActiveState initialState = null, bool bStartActive = true) { stateStack = new Stack<ActiveState>(); if(initialState != null) { stateStack.Push(initialState); } bIsActive = bStartActive; }
public virtual void State_Allow_Exit(int nextState) { ActiveState.AllowExit(); if (nextState != -1) { State_Activate(nextState); } }
private void OnInit() { if (Vector3.Distance(this.transform.position, this.InitialPos) > 0.3f) { this.transform.position = Vector3.Lerp(this.transform.position, this.InitialPos, Time.deltaTime * this.InitRaiseSpeed); return; } this.CurrentState = ActiveState.Trace; }
private void StopActiveState() { _stateExecution?.Dispose(); ActiveState?.Exit(); ActiveState = null; Context = null; _stateExecution = null; }
void OnTriggerExit(Collider other) { if (other.CompareTag("Player")) { Debug.Log("Player not near car anymore"); playerInsideTrigger = false; ActiveState.SetActive(GlobalHandler.Instance.upArrow, false); } }
void OnTriggerEnter(Collider other) { if (other.CompareTag("Player")) { playerInsideTrigger = true; //Show Up Arrows ActiveState.SetActive(GlobalHandler.Instance.upArrow, true); } }
public void Update() { ActiveState currentState = GetCurrentState(); if (bIsActive && currentState != null) { currentState(); } }
/// <summary> /// Fully featured constructor for creating a new block /// </summary> /// <param name="id">Id to associate with this block</param> /// <param name="spriteSheet">Spritesheet to use for the block</param> /// <param name="position">Position of the block</param> /// <param name="effects">Effects to apply when the block is interacted with</param> /// <param name="onStep">If the block's effects are applied when it is stepped on, as opposed to when it is touched</param> /// <param name="passability">Passability of the block. Default is FULLY_PASSABLE</param> /// <param name="activeTime">How long the block is active for in seconds</param> /// <param name="inactiveTime">How long the block is inactive for in seconds</param> /// <param name="frameTime">How long each frame displays for in seconds</param> public Portal(String id, Texture2D spriteSheet, Vector2 position, List<Effect> effects, bool onStep, int[,] activePassability, int[,] inactivePassability, Condition passabilityCondition, float activeTime, float inactiveTime, float frameTime, float effectDelay) : base(id, spriteSheet, position, null, false, Block.FULLY_PASSABLE) { portalExit = null; if (id.Contains("Entrance")) { state = new ActiveState(this); } }
public void Activate() { if (active != ActiveState.NotStarted) throw new InvalidOperationException("Wrong state"); active = ActiveState.Active; dbg = zm.Debug(); src = new SourceCache(sourcePath); io.PutString("ZLR Debugger\n"); dbg.Restart(); ShowStatus(); }
public override void Reset() { base.Reset(); // Remove UIObject UIManager.Instance.RemoveUIObject(this); m_RemoveUIObject = false; if (m_Effect != null) m_Effect.Reset(); m_ActiveState = ActiveState.eInActive; }
override public void ShowGUI(List<ActionParameter> parameters) { parameterID = Action.ChooseParameterGUI("Object to affect:", parameters, parameterID, ParameterType.GameObject); if (parameterID >= 0) { constantID = 0; objToAffect = null; } else { objToAffect = (GameObject)EditorGUILayout.ObjectField("Object to affect:", objToAffect, typeof(GameObject), true); constantID = FieldToID(objToAffect, constantID); objToAffect = IDToField(objToAffect, constantID, false); } activeState = (ActiveState)EditorGUILayout.EnumPopup("Active State", activeState); AfterRunningOption (); }
public bool Setup( NamedObject _FollowUnit , int _ReferenceRectIndex ) { if( false == this.enabled ) return false ; // 檢查CameraFollower是否政在運作中 CameraFollowMainCharacter follower = GlobalSingleton.GetCameraFollowMainCharacter() ; if( null != follower && false == follower.enabled ) return false ; if( null == m_BattleEventCamera || null == m_CameraFollower || _ReferenceRectIndex < 0 || _ReferenceRectIndex >= 4 ) return false ; // Debug.Log( "_ReferenceRectIndex=" + _ReferenceRectIndex ) ; m_BattleEventCamera.rect = m_ReferenceRects[ _ReferenceRectIndex ] ; ShowGUITexture.Show( m_Arrows.Obj , false , false , true ) ;// hide all arrows ShowGUITexture.Show( m_ArrowObjs[ _ReferenceRectIndex ].Obj , true , false , false ) ;// show only arrow m_CameraFollower.Setup( _FollowUnit ) ; m_FollowUnit.Setup( _FollowUnit ) ; m_BattleEventCamera.enabled = true ; m_State = ActiveState.Active ; return true ; }
public void Close() { if( null == m_BattleEventCamera || null == m_CameraFollower ) return ; ShowGUITexture.Show( m_Arrows.Obj , false , false , true ) ;// hide all arrows m_CameraFollower.Close() ; m_BattleEventCamera.enabled = false ; m_State = ActiveState.UnActive ; }
public void SetupByTime( NamedObject _FollowUnit , int _ReferenceRectIndex , float _ElapsedSec ) { if( false == Setup( _FollowUnit , _ReferenceRectIndex ) ) return ; m_Timer.Setup( _ElapsedSec ) ; m_Timer.Rewind() ; m_State = ActiveState.ActiveByTime; }
public void HandleCommand(string cmd) { if (cmd.Trim() == "") { if (lastCmd == null) { io.PutString("No last command.\n"); ShowStatus(); return; } cmd = lastCmd; } else { lastCmd = cmd; } string[] parts = cmd.Split(COMMAND_DELIM, StringSplitOptions.RemoveEmptyEntries); switch (parts[0].ToLower()) { case "reset": dbg.Restart(); break; case "s": case "step": if (dbg.State == DebuggerState.Paused) dbg.StepInto(); break; case "o": case "over": if (dbg.State == DebuggerState.Paused) dbg.StepOver(); break; case "up": if (dbg.State == DebuggerState.Paused) dbg.StepUp(); break; case "sl": case "stepline": DoStepLine(); break; case "ol": case "overline": DoOverLine(); break; case "r": case "run": if (dbg.State == DebuggerState.Stopped) dbg.Restart(); dbg.Run(); break; case "b": case "break": DoSetBreakpoint(parts); break; case "c": case "clear": DoClearBreakpoint(parts); break; case "bps": case "breakpoints": DoShowBreakpoints(); break; case "tc": case "tracecalls": DoToggleTraceCalls(); break; case "bt": case "backtrace": DoShowBacktrace(); break; case "l": case "locals": DoShowLocals(); break; case "g": case "globals": io.PutString("Not implemented.\n"); break; case "q": case "quit": io.PutString("Goodbye.\n"); active = ActiveState.Finished; return; default: Console.WriteLine("Unrecognized debugger command."); Console.WriteLine("Commands:"); Console.WriteLine("reset, (s)tep, (o)ver, stepline (sl), overline (ol), up, (r)un,"); Console.WriteLine("(b)reak, (c)lear, breakpoints (bps), tracecalls (tc)"); Console.WriteLine("backtrace (bt), (l)ocals, (g)lobals"); Console.WriteLine("(q)uit"); break; } ShowStatus(); }
private void SetPreviousState() { m_PreviousState = m_ActiveState; }
public void GotoPreviousState() { m_ActiveState = m_PreviousState; }
public virtual void Enable() { // Set active state to enabled m_ActiveState = ActiveState.eState_Enabled; // Set opacity to full SetOpacity(1.0f); // Set to render ActiveRender = true; }
/// <summary> /// Sets the state to active /// </summary> public void Activate() { state = new ActiveState(this); }
void OnTriggerStay(Collider other) { if (this.CurrentState == ActiveState.Trace && other.gameObject != this.User && other.gameObject != GameObject.Find("Ground") && other.gameObject.tag != "Bomb") { this.FoundTarget = other.gameObject; this.CurrentState = ActiveState.Attack; } }
public virtual void OnRemove() { m_ActiveState = ActiveState.eOut; if (m_Effect != null) m_Effect.OnExit(); else UIManager.Instance.RemoveUIObject(this); }
public void SetActiveState(ActiveState activeState) { SetPreviousState(); m_ActiveState = activeState; }
// use Physics.OverlapSphere void OnTriggerExit(Collider other) { this.InitialPos.Set(this.transform.position.x, this.InitialPos.y, this.transform.position.z); this.CurrentState = ActiveState.Init; }
/// <remarks/> public string EndGetSubscriptionProperties(System.IAsyncResult asyncResult, out ExtensionSettings ExtensionSettings, out string Description, out ActiveState Active, out string Status, out string EventType, out string MatchData, out ParameterValue[] Parameters) { object[] results = this.EndInvoke(asyncResult); ExtensionSettings = ((ExtensionSettings)(results[1])); Description = ((string)(results[2])); Active = ((ActiveState)(results[3])); Status = ((string)(results[4])); EventType = ((string)(results[5])); MatchData = ((string)(results[6])); Parameters = ((ParameterValue[])(results[7])); return ((string)(results[0])); }
public void PushState(ActiveState newState) { stateStack.Push(newState); }
public string GetSubscriptionProperties(string SubscriptionID, out ExtensionSettings ExtensionSettings, out string Description, out ActiveState Active, out string Status, out string EventType, out string MatchData, out ParameterValue[] Parameters) { object[] results = this.Invoke("GetSubscriptionProperties", new object[] { SubscriptionID}); ExtensionSettings = ((ExtensionSettings)(results[1])); Description = ((string)(results[2])); Active = ((ActiveState)(results[3])); Status = ((string)(results[4])); EventType = ((string)(results[5])); MatchData = ((string)(results[6])); Parameters = ((ParameterValue[])(results[7])); return ((string)(results[0])); }
public virtual void Disable() { // Set active state to disabled m_ActiveState = ActiveState.eState_Disabled; }
public virtual void OnShow() { m_ActiveState = ActiveState.eIn; if (m_Effect != null) m_Effect.OnEnter(); }
public void Focus() { SetPreviousState(); m_ActiveState = ActiveState.eFocus; }
public ActiveTestFunction(VehicleDB db, IChannel chn, IFormat format) : base(db, chn, format) { actMap = new Dictionary<int, Action<ActiveState>>(); state = ActiveState.Stop; }