private void onTargetMMOItemChanged(CPMMOItem obj)
    {
        IslandTargetMMOItem islandTargetMMOItem = obj as IslandTargetMMOItem;

        if (islandTargetMMOItem == null || !gameObjectIdToIslandTargetComponentMap.ContainsKey(islandTargetMMOItem.Id.Id))
        {
            return;
        }
        IslandTarget islandTarget = gameObjectIdToIslandTargetComponentMap[islandTargetMMOItem.Id.Id];

        if (!(islandTarget != null))
        {
            return;
        }
        if (islandTargetMMOItem.IsAnnihilated())
        {
            islandTarget.CueDestroyTargetByServer();
            TargetsRemaining--;
            dispatcher.DispatchEvent(new IslandTargetsEvents.TargetsRemainingUpdated(TargetsRemaining, TotalTargets));
            if (TargetsRemaining == 0)
            {
                dispatcher.DispatchEvent(default(IslandTargetsEvents.GameRoundEnded));
                LogWaveComplete();
                currentGameMMOItemId = -1L;
            }
        }
        else
        {
            islandTarget.DamageCapacity    = islandTargetMMOItem.HitCapacity;
            islandTarget.ServerDamageCount = islandTargetMMOItem.HitCount;
            islandTarget.UpdateDamageSlider();
            dispatcher.DispatchEvent(new IslandTargetsEvents.TargetHit(islandTargetMMOItem.HitCapacity, islandTargetMMOItem.HitCount));
        }
    }
    private void onIslandTargetMMOItemAdded(DataEntityHandle handle, ServerObjectItemData serverObjectItemData, IslandTargetMMOItem islandTargetMmoItem)
    {
        if (dataModelHandleListenersMap.ContainsKey(handle) || !childrenPaths.Contains(islandTargetMmoItem.Path))
        {
            return;
        }
        Transform transform = base.gameObject.transform.Find(islandTargetMmoItem.Path);

        if (!(transform != null))
        {
            return;
        }
        transform.gameObject.SetActive(value: true);
        dataModelHandleListenersMap[handle] = serverObjectItemData;
        IslandTarget component = transform.gameObject.GetComponent <IslandTarget>();

        if (component != null)
        {
            gameObjectIdToIslandTargetComponentMap[islandTargetMmoItem.Id.Id] = component;
            if (!islandTargetMmoItem.IsAnnihilated())
            {
                serverObjectItemData.ItemChanged += onTargetMMOItemChanged;
                component.DamageCapacity          = islandTargetMmoItem.HitCapacity;
                component.ServerDamageCount       = islandTargetMmoItem.HitCount;
                CoroutineRunner.Start(DelayTargetAppearance(delayBetweenRounds, component, islandTargetMmoItem), this, "DelayTargetAppearanceBetweenRounds");
                TargetsRemaining++;
                dispatcher.DispatchEvent(new IslandTargetsEvents.TargetsRemainingUpdated(TargetsRemaining, TotalTargets));
            }
        }
    }