Back to project page Tanks.
The source code is released under:
MIT License
If you think the Android project Tanks listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.ThirtyNineEighty.Game.Gameplay; /* ww w . jav a2s.co m*/ import com.ThirtyNineEighty.Game.Gameplay.Characteristics.Characteristic; import com.ThirtyNineEighty.Game.Gameplay.Characteristics.Upgrade; import com.ThirtyNineEighty.Game.EngineObject; import java.util.ArrayList; public abstract class GameObject extends EngineObject { private Characteristic baseCharacteristics; private Characteristic characteristics; private ArrayList<Upgrade> upgrades; protected GameObject(Characteristic characteristics) { super(characteristics.visualModelName, characteristics.phModelName, characteristics.textureName); baseCharacteristics = characteristics; upgrades = new ArrayList<Upgrade>(); setCurrentCharacteristics(); } protected void setCurrentCharacteristics() { characteristics = new Characteristic(baseCharacteristics); for (Upgrade upgrade : upgrades) upgrade.doUpgrade(characteristics); } public void addUpgrade(Upgrade upgrade) { upgrades.add(upgrade); } public void removeUpgrade(Upgrade upgrade) { upgrades.remove(upgrade); } public Characteristic getCharacteristics() { return characteristics; } }