コード例 #1
0
 public void ResetDamage()
 {
     currentHitPoints   = maxHitPoints;
     isInvulnerable     = false;
     m_timeSinceLastHit = 0.0f;
     OnReset.Invoke();
 }
コード例 #2
0
        private void Reset(UserId userId)
        {
            ActiveItemsManager = new ActiveItemsManager(this);
            Info              = new UserInfo(userId, this);
            ItemManager       = new ItemManager(this);
            RoomManager       = new RoomManager(this);
            MessageManager    = new MessageManager(this);
            QuestManager      = new QuestManager(this);
            DatabaseVariables = new DatabaseVariables();

            if (VariableManager != null)
            {
                VariableManager.Reset();
            }
            else
            {
                VariableManager = new VariableManager();
            }

            if (Token == Guid.Empty)
            {
                Token = Guid.NewGuid();
            }

            OnReset?.Invoke(this);
        }
コード例 #3
0
 public void Reset()
 {
     if (OnReset != null)
     {
         OnReset.Invoke();
     }
 }
コード例 #4
0
    public void SetNextCharacter()
    {
        if (currentCharacterNumber != -1)
        {
            characters[currentCharacterNumber].survival.OnDeath -= SetNextCharacter;
        }
        currentCharacterNumber++;
        if (currentCharacterNumber > characters.Count - 1)
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
        }
        for (int i = 0; i <= currentCharacterNumber; i++)
        {
            characters[i].gameObject.SetActive(true);
            Debug.Log("Spawn: " + spawnPoint.position);
            characters[i].transform.position = spawnPoint.position;
            characters[i].Reset();
            OnReset?.Invoke();
            //todo resettare a modino
        }
        ServiceLocator.Locate <InputManager>().ActiveEntity = characters[currentCharacterNumber].entity;
        for (int i = 0; i < currentCharacterNumber; i++)
        {
            characters[i].entity.GOJHONNYGO();
        }
        characters[currentCharacterNumber].survival.OnDeath += SetNextCharacter;

        characterUi.UpdateImages(currentCharacterNumber);
    }
コード例 #5
0
        internal static void ResetInternal()
        {
            if (OnReset != null)
            {
                OnReset.Invoke();
            }

            OnSetup  = null;
            OnUpdate = null;
            OnReset  = null;
            OnActiveDeviceChanged = null;
            OnDeviceAttached      = null;
            OnDeviceDetached      = null;
            OnUpdateDevices       = null;
            OnCommitDevices       = null;

            DestroyDeviceManagers();
            DestroyDevices();

            playerActionSets.Clear();

            MouseProvider.Reset();
            KeyboardProvider.Reset();

            IsSetup = false;
        }
コード例 #6
0
        private async Task ResetAsync()
        {
            var consumerName = eventConsumer.Name;

            var actionId = Guid.NewGuid().ToString();

            try
            {
                log.LogInformation(w => w
                                   .WriteProperty("action", "EventConsumerReset")
                                   .WriteProperty("actionId", actionId)
                                   .WriteProperty("state", "Started")
                                   .WriteProperty("eventConsumer", consumerName));

                await eventConsumer.ClearAsync();

                await eventConsumerInfoRepository.SetLastHandledEventNumberAsync(consumerName, -1);

                log.LogInformation(w => w
                                   .WriteProperty("action", "EventConsumerReset")
                                   .WriteProperty("actionId", actionId)
                                   .WriteProperty("state", "Completed")
                                   .WriteProperty("eventConsumer", consumerName));

                OnReset?.Invoke();
            }
            catch (Exception ex)
            {
                log.LogFatal(ex, w => w
                             .WriteProperty("action", "EventConsumerReset")
                             .WriteProperty("actionId", actionId)
                             .WriteProperty("state", "Completed")
                             .WriteProperty("eventConsumer", consumerName));
            }
        }
コード例 #7
0
ファイル: ManagedPlayer.cs プロジェクト: kurena-777/NFugue
 public void Reset()
 {
     IsStarted  = false;
     IsPaused   = false;
     IsFinished = false;
     OnReset?.Invoke(this, EventArgs.Empty);
 }
コード例 #8
0
    private void Reset()
    {
        jumpIsReady = true;

        transform.position = startingPosition;
        rBody.velocity     = Vector3.zero;
        OnReset?.Invoke();
    }
コード例 #9
0
 public override void Reset()
 {
     IsInteracting = false;
     IsComplete    = false;
     actionTimeout = null;
     OnReset.Invoke();
     InteractingAgents.Clear();
 }
コード例 #10
0
        public void Reset()
        {
            //code for resetting all states and objects in the app. Now just firing event

            StateManagerUI.ChangeState(StateUI.Reset);
            StateManagerUI.ChangeState(StateUI.Selection);
            OnReset.Invoke();
        }
コード例 #11
0
 public void ResetCommands()
 {
     commands.Clear();
     commandIndex       = 0;
     transform.position = Vector3.zero;
     transform.rotation = Quaternion.identity;
     OnReset?.Invoke();
 }
コード例 #12
0
 // Start is called before the first frame update
 protected sealed override void Start()
 {
     base.Start();
     OnStart.AddListener(updateText);
     OnTick.AddListener(updateText);
     OnReset.AddListener(updateText);
     ResetCountdown();
 }
コード例 #13
0
 private void ResetGame()
 {
     _score          = 0;
     _scoreText.text = "0";
     OnReset?.Invoke(false);
     OnIsRoundCommenced?.Invoke(false);
     _roundStarted = false;
 }
コード例 #14
0
ファイル: RdsClient.cs プロジェクト: Roman-Port/LibSDR
 public void Reset()
 {
     foreach (var f in features)
     {
         f.Reset(this);
     }
     OnReset?.Invoke(this);
 }
コード例 #15
0
 public void ResetToDefaults(PlayerCharacterModel data)
 {
     MaxHealth = data.MaxHealth;
     CurrentHealth.SetValueAndForceNotify(data.MaxHealth);
     Damage = data.Damage;
     Position.SetValueAndForceNotify(data.Position.Value);
     Rotation = data.Rotation;
     OnReset?.Execute(this);
 }
コード例 #16
0
        public async Task Reset()
        {
            if (RegexMode)
            {
                await ToggleRegexMode();
            }

            foreach (DictionaryEntry?entry in _columns.Cast <DictionaryEntry?>().ToList())
            {
                if (entry == null || !(entry.Value.Value is Column c) || c?.Default == null)
                {
                    continue;
                }

                Column n = c.Default.Clone();
                n.Key = c.Key;
                n.TryCompileFilter();
                n.Default = c.Default;

                _columns[entry.Value.Key] = n;

                await StoreColumnConfig(n);

                if (c.Shown != n.Shown)
                {
                    OnColumnVisibilityUpdate?.Invoke(c.ID);
                }
            }

            // foreach (Column? c in _columns.Values)
            // {
            //     if (c == null) continue;
            //
            //     // c = c.Default;
            //
            //     c.Shown         = true;
            //     c.FilterValue   = "";
            //     c.SortDirection = SortDirections.Neutral;
            //     c.SortIndex     = 0;
            //
            //     if (RegexMode)
            //         c.TryCompileFilter();
            //
            //     await StoreColumnConfig(c);
            // }

            if (_initialPageSize != PageSize)
            {
                await UpdatePageSize(_initialPageSize);
            }

            InvalidateRows();

            await FirstPage();

            OnReset?.Invoke();
        }
コード例 #17
0
ファイル: Thief.cs プロジェクト: AzdineElJattari/ThievingML
    public override void OnEpisodeBegin()
    {
        jumpIsReady        = true;
        transform.position = startingPosition;
        body.velocity      = Vector3.zero;

        environment.ClearEnvironment();
        OnReset?.Invoke();
    }
コード例 #18
0
        public virtual async Task Reset()
        {
            TStartDate = null;
            TEndDate   = null;

            await ClickApply(null);

            await OnReset.InvokeAsync(null);
        }
コード例 #19
0
        public void Reset()
        {
            this._rules            = new List <string>();
            this._rulesToInsert    = new List <string>();
            this._counter          = 0;
            this._classNamesToArgs = new Dictionary <string, Tuple <Style[], string[]> >();
            this._keyToClassName   = new Dictionary <string, string>();

            OnReset?.Invoke(this, new EventArgs());
        }
コード例 #20
0
 public void Reset()
 {
     Duration     = 0;
     Slider.value = 0;
     IsLocked     = false;
     if (OnReset != null)
     {
         OnReset.Invoke(this, EventArgs.Empty);
     }
 }
コード例 #21
0
 // Set default values
 public void Reset()
 {
     m_Speed             = m_InitialSpeed;
     m_FramesBeforeSpawn = m_SpawnNothingForFirstFrames;
     foreach (var spawner in Spawners)
     {
         spawner.Reset();
     }
     OnReset?.Invoke();
 }
コード例 #22
0
        public void Reset()
        {
            Content.Reset();
            Entities.Clear();
            Models.Clear();
            Materials.Entries.Clear();

            createCoreEntities();

            OnReset?.Invoke(this, new ResetEventArgs());
        }
コード例 #23
0
ファイル: Jumper.cs プロジェクト: TimoBrandt1/ML-JumpingCar
    private void Reset()
    {
        score       = 0;
        jumpIsReady = true;

        //Reset Movement and Position
        transform.position = startingPosition;
        rBody.velocity     = Vector3.zero;

        OnReset?.Invoke();
    }
コード例 #24
0
ファイル: Arena.cs プロジェクト: myarichuk/Simple.Arena
        /// <summary>
        /// Reset the Arena, useful to reuse the Arena's in an object pool
        /// </summary>
        public void Reset()
        {
            if (IsDisposed)
            {
                Throw.ObjectDisposed(nameof(Arena));
            }

            ResetCount++;
            Unsafe.InitBlock(_memoryBlock, 0, (uint)TotalBytes);
            AllocatedBytes = 0;
            OnReset?.Invoke();
        }
コード例 #25
0
    public override void OnEpisodeBegin()
    {
        score  = 0;
        moving = false;
        StopAllCoroutines();

        transform.position = startingPosition;
        currentRoadIndex   = roads.Length / 2;
        rb.velocity        = Vector3.zero;

        OnReset?.Invoke();
    }
コード例 #26
0
ファイル: Jump.cs プロジェクト: divinosdev/Unity-ML-Agents
    private void Reset()
    {
        ManagerScript.instance.score          = 0;
        ManagerScript.instance.scoreText.text = "Score: " + ManagerScript.instance.score;
        isGrounded = false;

        //Reset Movement and Position
        transform.position = startingPosition;
        rb.velocity        = Vector3.zero;

        OnReset?.Invoke();
    }
コード例 #27
0
ファイル: Field.cs プロジェクト: giladfrid009/Minefield
        public void Reset()
        {
            for (int row = 0; row < Height; row++)
            {
                for (int col = 0; col < Width; col++)
                {
                    SolField[row, col] = Hidden;
                    UnsField[row, col] = Hidden;
                }
            }

            OnReset?.Invoke(this);
        }
コード例 #28
0
 private bool Initialise(string continent)
 {
     if (search == null || continent != search.continent)
     {
         HasInitialised          = true;
         PathGraph.SearchEnabled = false;
         search = new Search(continent, logger);
         search.PathGraph.triangleWorld.NotifyChunkAdded = (e) => OnChunkAdded?.Invoke(e);
         OnReset?.Invoke();
         return(true);
     }
     return(false);
 }
コード例 #29
0
 /// <summary>
 /// This event is fired after a file is uploaded, and is used to notify subscribers of the OnChange event.
 /// </summary>
 private void ResetFinished()
 {
     try
     {
         // Notify the client the Reset button was clicked.
         OnReset.InvokeAsync("Reset");
     }
     catch (Exception error)
     {
         // for debugging only
         _ = error.ToString();
     }
 }
コード例 #30
0
        private void CloseLogFile(bool raiseOnResetEvent)
        {
            if (FileConnection != null)
            {
                FileConnection.Dispose();
                FileConnection = null;
            }

            if (raiseOnResetEvent)
            {
                OnReset?.Invoke();
            }
        }
コード例 #31
0
ファイル: Instantiation.cs プロジェクト: Robobeurre/NRaas
        // From SimDescription.Instantiate
        private static Sim Perform(SimDescription ths, Vector3 position, ResourceKey outfitKey, bool forceAlwaysAnimate, OnReset reset)
        {
            Household.HouseholdSimsChangedCallback changedCallback = null;
            Household changedHousehold = null;

            bool isChangingWorlds = GameStates.sIsChangingWorlds;

            bool isLifeEventManagerEnabled = LifeEventManager.sIsLifeEventManagerEnabled;

            Corrections.RemoveFreeStuffAlarm(ths);

            using (SafeStore store = new SafeStore(ths, SafeStore.Flag.LoadFixup | SafeStore.Flag.Selectable | SafeStore.Flag.Unselectable))
            {
                try
                {
                    // Stops the memories system from interfering
                    LifeEventManager.sIsLifeEventManagerEnabled = false;

                    // Stops UpdateInformationKnownAboutRelationships()
                    GameStates.sIsChangingWorlds = true;

                    if (ths.Household != null)
                    {
                        changedCallback = ths.Household.HouseholdSimsChanged;
                        changedHousehold = ths.Household;

                        ths.Household.HouseholdSimsChanged = null;
                    }

                    if (ths.CreatedSim != null)
                    {
                        AttemptToPutInSafeLocation(ths.CreatedSim, false);

                        if (reset != null)
                        {
                            ths.CreatedSim.SetObjectToReset();

                            reset(ths.CreatedSim, false);
                        }

                        return ths.CreatedSim;
                    }

                    if (ths.AgingState != null)
                    {
                        bool flag = outfitKey == ths.mDefaultOutfitKey;

                        ths.AgingState.SimBuilderTaskDeferred = false;

                        ths.AgingState.PreInstantiateSim(ref outfitKey);
                        if (flag)
                        {
                            ths.mDefaultOutfitKey = outfitKey;
                        }
                    }

                    int capacity = forceAlwaysAnimate ? 0x4 : 0x2;
                    Hashtable overrides = new Hashtable(capacity);
                    overrides["simOutfitKey"] = outfitKey;
                    overrides["rigKey"] = CASUtils.GetRigKeyForAgeGenderSpecies((ths.Age | ths.Gender) | ths.Species);
                    if (forceAlwaysAnimate)
                    {
                        overrides["enableSimPoseProcessing"] = 0x1;
                        overrides["animationRunsInRealtime"] = 0x1;
                    }

                    string instanceName = "GameSim";
                    ProductVersion version = ProductVersion.BaseGame;
                    if (ths.Species != CASAgeGenderFlags.Human)
                    {
                        instanceName = "Game" + ths.Species;
                        version = ProductVersion.EP5;
                    }

                    SimInitParameters initData = new SimInitParameters(ths);
                    Sim target = GlobalFunctions.CreateObjectWithOverrides(instanceName, version, position, 0x0, Vector3.UnitZ, overrides, initData) as Sim;
                    if (target != null)
                    {
                        if (target.SimRoutingComponent == null)
                        {
                            // Performed to ensure that a useful error message is produced when the Sim construction fails
                            target.OnCreation();
                            target.OnStartup();
                        }

                        target.SimRoutingComponent.EnableDynamicFootprint();
                        target.SimRoutingComponent.ForceUpdateDynamicFootprint();

                        ths.PushAgingEnabledToAgingManager();

                        /* This code is idiotic
                        if ((ths.Teen) && (target.SkillManager != null))
                        {
                            Skill skill = target.SkillManager.AddElement(SkillNames.Homework);
                            while (skill.SkillLevel < SimDescription.kTeenHomeworkSkillStartLevel)
                            {
                                skill.ForceGainPointsForLevelUp();
                            }
                        }
                        */

                        // Custom
                        OccultTypeHelper.SetupForInstantiatedSim(ths.OccultManager);

                        if (ths.IsAlien)
                        {
                            World.ObjectSetVisualOverride(target.ObjectId, eVisualOverrideTypes.Alien, null);
                        }

                        AttemptToPutInSafeLocation(target, false);

                        EventTracker.SendEvent(EventTypeId.kSimInstantiated, null, target);

                        /*
                        MiniSimDescription description = MiniSimDescription.Find(ths.SimDescriptionId);
                        if ((description == null) || (!GameStates.IsTravelling && (ths.mHomeWorld == GameUtils.GetCurrentWorld())))
                        {
                            return target;
                        }
                        description.UpdateInWorldRelationships(ths);
                        */

                        if (ths.HealthManager != null)
                        {
                            ths.HealthManager.Startup();
                        }

                        if (((ths.SkinToneKey.InstanceId == 15475186560318337848L) && !ths.OccultManager.HasOccultType(OccultTypes.Vampire)) && (!ths.OccultManager.HasOccultType(OccultTypes.Werewolf) && !ths.IsGhost))
                        {
                            World.ObjectSetVisualOverride(ths.CreatedSim.ObjectId, eVisualOverrideTypes.Genie, null);
                        }

                        if (ths.Household.IsAlienHousehold)
                        {
                            (Sims3.UI.Responder.Instance.HudModel as HudModel).OnSimCurrentWorldChanged(true, ths);
                        }

                        if (Household.RoommateManager.IsNPCRoommate(ths.SimDescriptionId))
                        {
                            Household.RoommateManager.AddRoommateInteractions(target);
                        }
                    }

                    return target;
                }
                finally
                {
                    LifeEventManager.sIsLifeEventManagerEnabled = isLifeEventManagerEnabled;

                    GameStates.sIsChangingWorlds = isChangingWorlds;

                    if ((changedHousehold != null) && (changedCallback != null))
                    {
                        changedHousehold.HouseholdSimsChanged = changedCallback;

                        if (changedHousehold.HouseholdSimsChanged != null)
                        {
                            changedHousehold.HouseholdSimsChanged(Sims3.Gameplay.CAS.HouseholdEvent.kSimAdded, ths.CreatedSim, null);
                        }
                    }
                }
            }
        }        
コード例 #32
0
ファイル: Instantiation.cs プロジェクト: Robobeurre/NRaas
        public static Sim Perform(SimDescription ths, Vector3 position, SimOutfit outfit, OnReset reset)
        {
            try
            {
                ResourceKey outfitKey = ths.mDefaultOutfitKey;

                if (outfit == null)
                {
                    if (ths.IsHorse)
                    {
                        outfit = ths.GetOutfit(OutfitCategories.Naked, 0);
                    }
                    
                    if (outfit == null)
                    {
                        outfit = ths.GetOutfit(OutfitCategories.Everyday, 0);
                    }

                    if ((outfit == null) || (!outfit.IsValid))
                    {
                        return null;
                    }
                }

                if (outfit != null)
                {
                    outfitKey = outfit.Key;
                }

                return Perform(ths, position, outfitKey, true, reset);
            }
            catch (Exception e)
            {
                ths.mSim = null;

                ths.mDefaultOutfitKey = ResourceKey.kInvalidResourceKey;

                Common.Exception(ths, e);
            }

            return null;
        }
コード例 #33
0
ファイル: Instantiation.cs プロジェクト: Robobeurre/NRaas
        public static Sim Perform(SimDescription ths, Lot lot, OnReset reset)
        {
            Vector3 result = Vector3.Invalid;
            if (lot != null)
            {
                result = AttemptToFindSafeLocation(lot, ths.IsHorse);
                if (result == Vector3.Invalid)
                {
                    result = lot.EntryPoint();
                }
            }
            else
            {
                result = GetPositionInRandomLot(lot);
            }

            return Perform(ths, result, null, reset);
        }
コード例 #34
0
ファイル: Instantiation.cs プロジェクト: Robobeurre/NRaas
        public static Sim Perform(SimDescription ths, OnReset reset)
        {
            if (ths == null) return null;

            Lot lot = ths.LotHome;
            if (lot == null)
            {
                lot = ths.VirtualLotHome;
            }

            return Perform(ths, lot, reset);
        }
コード例 #35
0
ファイル: Instantiation.cs プロジェクト: Robobeurre/NRaas
        public static Sim PerformOffLot(SimDescription ths, Lot lot, SimOutfit outfit, OnReset reset)
        {
            if ((ths.CreatedSim != null) && (reset == null)) return ths.CreatedSim;

            return Perform(ths, GetPositionInRandomLot(lot), outfit, reset);
        }
コード例 #36
0
ファイル: Instantiation.cs プロジェクト: Robobeurre/NRaas
 public static Sim PerformOffLot(SimDescription ths, Lot lot, OnReset reset)
 {
     return PerformOffLot(ths, lot, null, reset);
 }