Package net.traviangui

Source Code of net.traviangui.testSearchAlly

package net.traviangui;
import java.io.File;
import java.io.FileWriter;

import net.traviangui.model.Ally;
import net.traviangui.model.MapSquareType;
import net.traviangui.model.Player;
import net.traviangui.model.Village;
import net.traviangui.model.MapWorld;



public class testSearchAlly
{
   
  public static void main(String[] args) throws Exception
  {
      Translator.load( "es");
     
//      Villages villages = new Villages( );
//       System.out.println( villages);
   
     
     
//      Village village = villages.getVillage( 89890);
     
//      System.out.println( village);
//      Thread.sleep( 2*1000);
//      System.out.println( village);

 
      FileWriter fos = new FileWriter( new File( "results.csv"));
     
      Ally ally = new Ally( 1365);
//      System.out.println( ally.toString());
        for( Player p : ally.getMembers()) {
            for( Village v : p.getVillages( )) {
                String villageName = v.getName().replace( "\r", "").replace( "\n", "");
                MapSquareType type = MapWorld.getMapSquare( v.getCoordX(), v.getCoordY()).getType();
                String str = String.format( "\"%s\",\"%s\",%d,%d,%s\n", p.getName(), villageName,
                        v.getCoordX(), v.getCoordY(), type.getName());
                fos.write( str);
                System.out.println( str);
            }
//            break;
      }
        fos.close();
  }
       

}
TOP

Related Classes of net.traviangui.testSearchAlly

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.