Package game.console.command

Source Code of game.console.command.PhysicsCommand

package game.console.command;

import engine.utility.Physics;
import engine.utility.PhysicsAnj;
import engine.utility.PhysicsDan;
import engine.utility.PhysicsDebug;
import game.console.Command;

public class PhysicsCommand extends Command {
    @Override
    public void execute(String[] args) {
        if (args.length < 1) {
            System.out.println("No argument specified. Please specify 'anj', 'dan' or 'debug'");
        } else if (args[0].equals("anj")) {
            Physics.setPhysicsMode(new PhysicsAnj());
            System.out.println("Now using anj's physics.");
        } else if (args[0].equals("dan")) {
            Physics.setPhysicsMode(new PhysicsDan());
            System.out.println("Now using dan's physics.");
        } else if (args[0].equals("debug")) {
            Physics.setPhysicsMode(new PhysicsDebug());
            System.out.println("Now using debug physics.");
        } else {
            System.out.println("Unknown argument.");
        }
    }
}
TOP

Related Classes of game.console.command.PhysicsCommand

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.