Scene:
1 levels of small to release skills, there are now 2 skills to choose from, Avalanche (V) and Toss (T), because it is a small 1 level, so you can only choose 2 skills of 1.
Creation of 4 bundles
Com.ferry.ability.api There is only one skill interface in the bundle.
Com.ferry.ability.avalanche there is only one implementation class in the bundle that implements the interface avalanche
Com.ferry.ability.toss there is only one implementation class in the bundle that implements the interface toss
Com.ferry.client The bundle calls the skill interface
The code and settings are as follows
Com.ferry.ability.api
[Java] view plain copy public interface iability {public int ability (Int. level); }
COM.FERRY.ABILITY.API Bundle Export Interface package for implementing bundle reference
Com.ferry.ability.Avalanche
[Java] view plain copy public class Avalanche implements iability {@Override public int ability (int Level) {System.out.println ("V"); return 100; } }
[Java] view plain copy
The skill interface implements the Bundel Com.ferry.ability.Avalanche and Com.ferry.ability.Toss Import interface package Com.ferry.ability.Toss
[Java] view plain copy public class toss implements iability {@Override public int ability (int leve L) {System.out.println ("T"); return 100; } }
Com.ferry.client
[Java] View plain copy public class hero implements commandprovider{ private IAbility ability; public void setability (iability ability) { this.ability = ability; } public Void unsetability (iability ability) { this.ability = null; } public void _countdamage (COMMANDINTERPRETER CI) { if (Ability!=null