private void Start() { myMaster = GetComponent <Character>(); idle = new CharacterIdle(myMaster, this); locomotion = new CharacterLocomotion(myMaster, this); jump = new CharacterJump(myMaster, this); fall = new CharacterFall(myMaster, this); climb = new CharacterClimb(myMaster, this); crouch = new CharacterCrouch(myMaster, this); zapped = new CharacterZapped(myMaster, this); turn = new CharacterTurn(myMaster, this); interact = new CharacterInteract(myMaster, this); death = new CharacterDeath(myMaster, this); dialogue = new CharacterDialogue(myMaster, this); disabled = new CharacterDisabled(myMaster, this); train = new CharacterEventTrain(myMaster, this); currentState = idle; //Special event niveau 1 if (!GameManager.instance.spcLvlMan.hasHead) { ChangeState(train); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='code'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <object> Get1Async(this IStates operations, string code, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.Get1WithHttpMessagesAsync(code, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
private bool Finance; //применение финансовых транзакций public Hack(IPlayer player) : base() { HackPrograms = new ObservableCollection <HackProgram>(); _states = player; _wallet = player; _score = player; }
// Use this for initialization void Start() { _actor = GetComponent <IActor> (); StartNode = grid.PostoNode(_actor.Position); currentState = calcState; currentState.Enter(); }
/// <summary> Appel la fonction Exit() du vieux state et le Enter() du nouveau </summary> /// <param name="newState"> Nouveau state </param> public void ChangeState(IStates newState) { currentState.Exit(); previousState = currentState; currentState = newState; currentState.Enter(); }
/// <param name='operations'> /// Reference to the ZtherApiIntegration.API.IStates. /// </param> /// <param name='code'> /// Required. /// </param> public static State GetByStateAbrrev(this IStates operations, string code) { return(Task.Factory.StartNew((object s) => { return ((IStates)s).GetByStateAbrrevAsync(code); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <param name='operations'> /// Reference to the ZtherApiIntegration.API.IStates. /// </param> public static StateList GetAll(this IStates operations) { return(Task.Factory.StartNew((object s) => { return ((IStates)s).GetAllAsync(); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> Конструктор с кошелем игрока </summary> public Happy(IPlayer player, IInfoSoft soft) : base() { _wallet = player; _soft = soft; _happy = player; _states = player; _score = player; }
public Rescuer(OrientedActor actor, OrientedActor teammate) { self = actor; teamMate = teammate; rescueState = new RescueState(self, teamMate); currentState = rescueState; currentState.Enter(); }
public Flagger(OrientedActor actor) { self = actor; attackState = new AttackState(self, this); returnState = new ReturnState(self, this); currentState = attackState; attackState.Enter(); }
public void ChangeState(IStates newState) { if (currentState != null) { currentState.Exit(); } currentState = newState; currentState.Enter(this); }
private void InitializeMachine <T>(IState initialState, IState errorState, IStates states, ITriggers triggers, IDisplayables displayables) where T : IMachine { var transitionHandler = _runtime.Container.Resolve <TransitionHandler>(new TypedParameter(typeof(IDisplayables), displayables)); var machine = _runtime.Container.Resolve <T>(new TypedParameter(typeof(TransitionHandler), transitionHandler)); machine.Start(initialState, errorState); machine.Configure(states, triggers); _initializedMachines.Add(machine); }
public void Configure(IStates states, ITriggers triggers) { if (_roomMachine == null) { throw new Exception(); } var roomsStates = (RoomsStates)states; var roomsTriggers = (RoomsTriggers)triggers; foreach (var roomState in roomsStates.rooms) { _roomMachine.Configure(roomState) .OnEntry(() => _transitionHandler.HandleEntry(roomState)) .OnExit(() => _transitionHandler.HandleExit(roomState)); if (!(String.IsNullOrEmpty(roomState.north))) { _roomMachine.Configure(roomState) .Permit(roomsTriggers.Fetch <RoomsTriggers.North>(), roomsStates.rooms.Single(rs => rs.id == roomState.north)); } if (!(String.IsNullOrEmpty(roomState.south))) { _roomMachine.Configure(roomState) .Permit(roomsTriggers.Fetch <RoomsTriggers.South>(), roomsStates.rooms.Single(rs => rs.id == roomState.south)); } if (!(String.IsNullOrEmpty(roomState.east))) { _roomMachine.Configure(roomState) .Permit(roomsTriggers.Fetch <RoomsTriggers.East>(), roomsStates.rooms.Single(rs => rs.id == roomState.east)); } if (!(String.IsNullOrEmpty(roomState.west))) { _roomMachine.Configure(roomState) .Permit(roomsTriggers.Fetch <RoomsTriggers.West>(), roomsStates.rooms.Single(rs => rs.id == roomState.west)); } if (!(String.IsNullOrEmpty(roomState.up))) { _roomMachine.Configure(roomState) .Permit(roomsTriggers.Fetch <RoomsTriggers.Up>(), roomsStates.rooms.Single(rs => rs.id == roomState.up)); } if (!(String.IsNullOrEmpty(roomState.down))) { _roomMachine.Configure(roomState) .Permit(roomsTriggers.Fetch <RoomsTriggers.Down>(), roomsStates.rooms.Single(rs => rs.id == roomState.down)); } } }
public Defender(OrientedActor actor) { self = actor; prevNode = self.currentNode; patrolState = new PatrolState(self, this); currentState = patrolState; influencedNodes = null; patrolState.Enter(); }
public BasicDataController(ICountries countries, IStates states, IRoles roles, IDepartments departments, IGender gender, INationality nationality, ICurrency currency, IIdentificationtypes identificationtypes, IMaritalstatuses maritalstatuses, IEntities entities)//, ITaxMaster tasMaster) { _countries = countries; _states = states; _roles = roles; _departments = departments; _gender = gender; _nationality = nationality; _currency = currency; _identificationtypes = identificationtypes; _maritalstatuses = maritalstatuses; _entities = entities; }
public void UpdateState(IStates state, bool PreviousState) { IStates PopedState; if (state == null) { _StateStack.Pop(); } else if (PreviousState == false) { PopedState = _StateStack.Pop(); Delete(PopedState); _StateStack.Push(state); } else if (PreviousState == true) { _StateStack.Push(state); } }
/// <summary> /// Initializes a new instance of the LandauWebAPI class. /// </summary> /// <param name='rootHandler'> /// Optional. The http client handler used to handle http transport. /// </param> /// <param name='handlers'> /// Optional. The set of delegating handlers to insert in the http /// client pipeline. /// </param> public LandauWebAPI(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { this._banners = new Banners(this); this._brands = new Brands(this); this._catalogs = new Catalogs(this); this._colors = new Colors(this); this._contactUs = new ContactUsOperations(this); this._countries = new Countries(this); this._groupOrders = new GroupOrders(this); this._images = new Images(this); this._productImages = new ProductImages(this); this._productReviews = new ProductReviews(this); this._products = new Products(this); this._questions = new Questions(this); this._retailers = new Retailers(this); this._seo = new SeoOperations(this); this._signUps = new SignUps(this); this._states = new States(this); this._swatches = new Swatches(this); this._baseUri = new Uri("http://microsoft-apiapp5dcb282abbf74b72ad1667c2-staging.azurewebsites.net:80"); }
public void Configure(IStates states, ITriggers triggers) { if (_gameMachine == null) { throw new Exception(); } var gameState = (GameStates)states; var gameTrigger = (GameTriggers)triggers; _gameMachine.Configure(gameState.Fetch <GameStates.Exited>()) .OnEntry(() => _transitionHandler.HandleEntry(gameState.Fetch <GameStates.Exited>())); _gameMachine.Configure(gameState.Fetch <GameStates.Inactive>()) .OnEntry(() => _transitionHandler.HandleEntry(gameState.Fetch <GameStates.Inactive>())) .Permit(gameTrigger.Fetch <GameTriggers.Exit>(), gameState.Fetch <GameStates.Exited>()) .Permit(gameTrigger.Fetch <GameTriggers.Begin>(), gameState.Fetch <GameStates.Active>()); _gameMachine.Configure(gameState.Fetch <GameStates.Running>()); _gameMachine.Configure(gameState.Fetch <GameStates.Active>()) .SubstateOf(gameState.Fetch <GameStates.Running>()) .OnEntry(() => _transitionHandler.HandleEntry(gameState.Fetch <GameStates.Active>())) .OnExit(() => _transitionHandler.HandleExit(gameState.Fetch <GameStates.Active>())) .Permit(gameTrigger.Fetch <GameTriggers.End>(), gameState.Fetch <GameStates.Inactive>()) .Permit(gameTrigger.Fetch <GameTriggers.Pause>(), gameState.Fetch <GameStates.Paused>()); _gameMachine.Configure(gameState.Fetch <GameStates.Paused>()) .SubstateOf(gameState.Fetch <GameStates.Running>()) .OnEntry(() => _transitionHandler.HandleEntry(gameState.Fetch <GameStates.Paused>())) .Permit(gameTrigger.Fetch <GameTriggers.Resume>(), gameState.Fetch <GameStates.Active>()) .Permit(gameTrigger.Fetch <GameTriggers.End>(), gameState.Fetch <GameStates.Inactive>()); _gameMachine.Configure(gameState.Fetch <GameStates.Error>()) .OnEntry(() => _transitionHandler.HandleEntry(gameState.Fetch <GameStates.Error>())); }
/// <summary> /// Initializes a new instance of the LandauPortalWebAPI class. /// </summary> /// <param name='rootHandler'> /// Optional. The http client handler used to handle http transport. /// </param> /// <param name='handlers'> /// Optional. The set of delegating handlers to insert in the http /// client pipeline. /// </param> public LandauPortalWebAPI(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { this._banners = new Banners(this); this._brands = new Brands(this); this._cache = new Cache(this); this._catalogs = new Catalogs(this); this._colors = new Colors(this); this._contactUs = new ContactUsOperations(this); this._countries = new Countries(this); this._emailFavorites = new EmailFavorites(this); this._groupOrders = new GroupOrders(this); this._images = new Images(this); this._productImages = new ProductImages(this); this._productReviews = new ProductReviews(this); this._products = new Products(this); this._questions = new Questions(this); this._retailers = new Retailers(this); this._seo = new SeoOperations(this); this._signUps = new SignUps(this); this._states = new States(this); this._swatches = new Swatches(this); this._baseUri = new Uri(API_ENDPOINT); }
public static bool ButtonsChanged(IStates value) { return(value.Previous.Buttons != value.Current.Buttons); }
/// <summary> /// Used with Tri-state switches. This tests if the switch was moved from the middle state /// </summary> public static bool MultiSwitchStateOn(IStates value, UInt32 switchValue) { return((value.Previous.Buttons & switchValue) == 0 && (value.Current.Buttons & switchValue) != 0); }
public static bool ButtonPressedOrReleased(IStates value, UInt32 button) { return(ButtonReleased(value, button) || ButtonPressed(value, button)); }
public static bool ButtonReleased(IStates value, UInt32 button) { return((value.Previous.Buttons & button) == button && (value.Current.Buttons & button) == 0); }
public static bool ButtonDown(IStates value, UInt32 button) { return((value.Current.Buttons & button) == button); }
void Delete(IStates State) { GC.SuppressFinalize(State); }
public void SetState(IStates state) { _StateStack.Push(state); }
public void setState(EStateType index) { this.CurrentState = (IStates)this.arrayList[(int)index]; }
public void addState(IStates state) { this.arrayList.Add(state); this.CurrentState = (IStates)this.arrayList[0]; }
public void ToSad() { currentState.ResetPathColor(); currentState = new SadState(self); currentState.Enter(); }
public void ToHappy() { currentState.ResetPathColor(); currentState = new HappyState(self); currentState.Enter(); }
public void Captured(OrientedActor capturer) { currentState = new CapturedState(self, capturer); }
/// <summary> Retourne au state precedent </summary> public void SwitchToPreviousState() { currentState.Exit(); currentState = previousState; currentState.Enter(); }