Package net.sf.robocode.peer

Examples of net.sf.robocode.peer.BulletCommand


  @Test
  public void withBullets() throws IOException {
    ExecCommands ec = new ExecCommands();

    ec.setBodyTurnRemaining(150.123);
    ec.getBullets().add(new BulletCommand(1.0, true, 0.9354, 11));
    ec.getBullets().add(new BulletCommand(1.0, false, 0.9454, 12));
    ec.getBullets().add(new BulletCommand(1.0, true, 0.9554, -128));

    ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
    RbSerializer rbs = new RbSerializer();

    rbs.serialize(out, RbSerializer.ExecCommands_TYPE, ec);
View Full Code Here


  @Test
  public void withMessages() throws IOException {
    ExecCommands ec = new ExecCommands();

    ec.setBodyTurnRemaining(150.123);
    ec.getBullets().add(new BulletCommand(1.0, true, 0.9354, 11));
    final byte[] data = new byte[20];

    data[10] = 10;
    ec.getTeamMessages().add(new TeamMessage("Foo", "Bar", data));
    ec.getTeamMessages().add(new TeamMessage("Foo", "Bar", null));
View Full Code Here

  @Test
  public void withProperties() throws IOException {
    ExecCommands ec = new ExecCommands();

    ec.setBodyTurnRemaining(150.123);
    ec.getBullets().add(new BulletCommand(1.0, true, 0.9354, 11));
    ec.getTeamMessages().add(new TeamMessage("Foo", "Bar", null));
    ec.getDebugProperties().add(
        new DebugProperty("UTF8 Native characters", "P��li� �lu?ou�k� k�� �p�l ��belsk� �dy"));

    ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
View Full Code Here

  // 15x faster
  public void speed() throws IOException {
    ExecCommands ec = new ExecCommands();

    ec.setBodyTurnRemaining(150.123);
    ec.getBullets().add(new BulletCommand(1.0, true, 0.9354, 11));
    ec.getBullets().add(new BulletCommand(1.0, true, 0.9354, 11));
    ec.getBullets().add(new BulletCommand(1.0, true, 0.9354, 11));
    ec.getTeamMessages().add(new TeamMessage("Foo", "Bar", null));
    ec.getDebugProperties().add(new DebugProperty("ooooh", "aaaah"));

    ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
View Full Code Here

  // 21 seconds for 100 000
  public void speed2() {
    ExecCommands ec = new ExecCommands();

    ec.setBodyTurnRemaining(150.123);
    ec.getBullets().add(new BulletCommand(1.0, true, 0.9354, 11));
    ec.getBullets().add(new BulletCommand(1.0, true, 0.9354, 11));
    ec.getBullets().add(new BulletCommand(1.0, true, 0.9354, 11));
    ec.getTeamMessages().add(new TeamMessage("Foo", "Bar", null));
    ec.getDebugProperties().add(new DebugProperty("ooooh", "aaaah"));

    ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
View Full Code Here

TOP

Related Classes of net.sf.robocode.peer.BulletCommand

Copyright © 2018 www.massapicom. 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.