Example #1
0
 public void RemoveEntity(int id)
 {
     m_entities[id].MarkForRemoval();
     m_entitiesChangedFlags |= EntitiesChangedFlags.Removed;
     m_dirtyEntities.Add(id);
     FightLogicExecutor.NotifyEntityRemoved(fightId);
 }
Example #2
0
        private void OnEntitiesChanged(FightStatus fightStatus, EntitiesChangedFlags flags)
        {
            int fightId = fightStatus.fightId;
            FightMapMovementContext fightMapMovementContext = m_movementContexts[fightId];

            if ((flags & (EntitiesChangedFlags.Added | EntitiesChangedFlags.Removed | EntitiesChangedFlags.AreaMoved)) != 0 && m_activeMovementContext == fightMapMovementContext)
            {
                ICharacterEntity trackedCharacter = fightMapMovementContext.trackedCharacter;
                if (trackedCharacter != null)
                {
                    fightMapMovementContext.End();
                    if (!trackedCharacter.isDirty)
                    {
                        fightMapMovementContext.Begin(trackedCharacter, m_pathFinder);
                    }
                    else
                    {
                        m_activeMovementContext = null;
                    }
                    m_feedbackNeedsUpdate = true;
                }
            }
            if (m_targetContext != null && (flags & (EntitiesChangedFlags.Removed | EntitiesChangedFlags.AreaMoved)) != 0)
            {
                m_targetContext.Refresh();
                m_feedbackNeedsUpdate = true;
            }
            if (m_interactiveMode == InteractiveMode.Movement && m_localMovementContext == fightMapMovementContext)
            {
                m_cellPointerManager.RefreshPlayableCharactersHighlights(this, fightStatus);
            }
            m_inputHandler.SetDirty();
        }
Example #3
0
 public void TriggerUpdateEvents()
 {
     if (m_entitiesChangedFlags != 0)
     {
         EntitiesChangedFlags entitiesChangedFlags = m_entitiesChangedFlags;
         m_entitiesChangedFlags = EntitiesChangedFlags.None;
         this.EntitiesChanged?.Invoke(this, entitiesChangedFlags);
     }
 }
Example #4
0
 public bool TryRemoveEntity(int id)
 {
     if (m_entities.TryGetValue(id, out EntityStatus value))
     {
         value.MarkForRemoval();
         m_entitiesChangedFlags |= EntitiesChangedFlags.Removed;
         m_dirtyEntities.Add(id);
         FightLogicExecutor.NotifyEntityRemoved(fightId);
         return(true);
     }
     return(false);
 }
Example #5
0
 public void AddEntity([NotNull] EntityStatus entity)
 {
     m_entities[entity.id]   = entity;
     m_entitiesChangedFlags |= EntitiesChangedFlags.Added;
 }
Example #6
0
 public void NotifyEntityPlayableStateChanged()
 {
     m_entitiesChangedFlags |= EntitiesChangedFlags.PlayableState;
 }
Example #7
0
 public void NotifyEntityAreaMoved()
 {
     m_entitiesChangedFlags |= EntitiesChangedFlags.AreaMoved;
 }