Factorize depth to interface

This commit is contained in:
Exund
2024-03-30 12:55:23 +01:00
committed by Jindra Petřík
parent ffda86028d
commit 8b17ed9b46
9 changed files with 59 additions and 6 deletions

View File

@@ -331,6 +331,11 @@ public class PlaceObject2Tag extends PlaceObjectTypeTag implements ASMSourceCont
return depth;
}
@Override
public void setDepth(int depth) {
this.depth = depth;
}
@Override
public MATRIX getMatrix() {
if (placeFlagHasMatrix) {

View File

@@ -518,6 +518,11 @@ public class PlaceObject3Tag extends PlaceObjectTypeTag implements ASMSourceCont
return depth;
}
@Override
public void setDepth(int depth) {
this.depth = depth;
}
@Override
public MATRIX getMatrix() {
if (placeFlagHasMatrix) {

View File

@@ -539,6 +539,11 @@ public class PlaceObject4Tag extends PlaceObjectTypeTag implements ASMSourceCont
return depth;
}
@Override
public void setDepth(int depth) {
this.depth = depth;
}
@Override
public MATRIX getMatrix() {
if (placeFlagHasMatrix) {

View File

@@ -173,6 +173,11 @@ public class PlaceObjectTag extends PlaceObjectTypeTag {
return depth;
}
@Override
public void setDepth(int depth) {
this.depth = depth;
}
@Override
public MATRIX getMatrix() {
return matrix;

View File

@@ -81,4 +81,9 @@ public class RemoveObject2Tag extends RemoveTag {
public int getDepth() {
return depth;
}
@Override
public void setDepth(int depth) {
this.depth = depth;
}
}

View File

@@ -97,6 +97,11 @@ public class RemoveObjectTag extends RemoveTag implements CharacterIdTag {
return depth;
}
@Override
public void setDepth(int depth) {
this.depth = depth;
}
@Override
public int getCharacterId() {
return characterId;

View File

@@ -0,0 +1,27 @@
/*
* Copyright (C) 2010-2023 JPEXS, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
*/
package com.jpexs.decompiler.flash.tags.base;
/**
*
* @author JPEXS
*/
public interface DepthTag {
public int getDepth();
public void setDepth(int depth);
}

View File

@@ -34,7 +34,7 @@ import java.util.Objects;
*
* @author JPEXS
*/
public abstract class PlaceObjectTypeTag extends Tag implements CharacterIdTag {
public abstract class PlaceObjectTypeTag extends Tag implements CharacterIdTag, DepthTag {
public PlaceObjectTypeTag(SWF swf, int id, String name, ByteArrayRange data) {
super(swf, id, name, data);
@@ -42,8 +42,6 @@ public abstract class PlaceObjectTypeTag extends Tag implements CharacterIdTag {
public abstract int getPlaceObjectNum();
public abstract int getDepth();
public abstract MATRIX getMatrix();
public abstract void setMatrix(MATRIX matrix);

View File

@@ -24,14 +24,12 @@ import com.jpexs.helpers.ByteArrayRange;
*
* @author JPEXS
*/
public abstract class RemoveTag extends Tag {
public abstract class RemoveTag extends Tag implements DepthTag {
public RemoveTag(SWF swf, int id, String name, ByteArrayRange data) {
super(swf, id, name, data);
}
public abstract int getDepth();
@Override
public String getName() {
String result = super.getName();