public void RemoveEntity(int id) { m_entities[id].MarkForRemoval(); m_entitiesChangedFlags |= EntitiesChangedFlags.Removed; m_dirtyEntities.Add(id); FightLogicExecutor.NotifyEntityRemoved(fightId); }
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(); }
public void TriggerUpdateEvents() { if (m_entitiesChangedFlags != 0) { EntitiesChangedFlags entitiesChangedFlags = m_entitiesChangedFlags; m_entitiesChangedFlags = EntitiesChangedFlags.None; this.EntitiesChanged?.Invoke(this, entitiesChangedFlags); } }
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); }
public void AddEntity([NotNull] EntityStatus entity) { m_entities[entity.id] = entity; m_entitiesChangedFlags |= EntitiesChangedFlags.Added; }
public void NotifyEntityPlayableStateChanged() { m_entitiesChangedFlags |= EntitiesChangedFlags.PlayableState; }
public void NotifyEntityAreaMoved() { m_entitiesChangedFlags |= EntitiesChangedFlags.AreaMoved; }