Esempio n. 1
0
    public override bool IsEquivalentItem(ITimeTracker other)
    {
        ExplodeBox otherExplode = other as ExplodeBox;

        if (otherExplode == null)
        {
            return(false);                              // incorrect object type
        }
        if (this.spritePath != otherExplode.spritePath)
        {
            return(false);                                                    // different labels matter
        }
        if (this.requiredActivatableIDs.Except(otherExplode.requiredActivatableIDs).Any())
        {
            return(false);                                                                                       // any difference in activatable IDs
        }
        return(base.IsEquivalentItem(other));
    }
Esempio n. 2
0
    public override void CopyTimeTrackerState(ITimeTracker other)
    {
        ExplodeBox otherBox = other as ExplodeBox;

        if (otherBox != null)
        {
            Position.Copy(otherBox.Position);
            ItemForm = otherBox.ItemForm;

            _shouldPoolObject = otherBox._shouldPoolObject;
            _isItemable       = otherBox._isItemable;

            spritePath = otherBox.spritePath;
            distance   = otherBox.distance;
            requiredActivatableIDs.AddRange(otherBox.requiredActivatableIDs);
            requiredActivatables.AddRange(otherBox.requiredActivatables);
        }
        else
        {
            gameController.LogError($"Cannot copy state from {other.GetType()} to {nameof(ExplodeBox)}");
        }
    }