Exemple #1
0
 public Town(TownCenterService service, GenericDatastoreRecord datastoreRecord)
 {
     this.service         = service;
     this.datastoreRecord = datastoreRecord;
     townVoxels           = datastoreRecord.GetSet <IVoxel>("TownVoxels");
     datastoreRecord.Bind(this);
 }
        public TownBordersMeshProvider(IMeshProvider provider, TownCenterService townCenterService)
        {
            this.provider          = provider;
            this.townCenterService = townCenterService;
            builder = new FourWayModelBuilder();

            var mBuilder = new MeshBuilder();

            mBuilder.AddBox(new Vector3(0.4f, 0, -0.5f), new Vector3(0.5f, 0.1f, 0.5f));

            builder.WayMesh   = new RAMMesh();
            builder.NoWayMesh = mBuilder.CreateMesh();
        }
        public void Setup()
        {
            var world = new SimpleWorld();

            town1center         = world.GetVoxel(0, 0);
            borderVoxel         = world.GetVoxel(1, 0);
            borderToBorderVoxel = world.GetVoxel(2, 0);
            town2BorderToTown1  = world.GetVoxel(0, 1);
            town2center         = world.GetVoxel(0, 2);

            var service = new TownCenterService(null, new GenericDatastoreRecord(null, 1));

            town1 = service.CreateTown(town1center);
            town2 = service.CreateTown(town2center);

            town1.AddVoxel(town1center);
            town2.AddVoxel(town2center);
            town2.AddVoxel(town2BorderToTown1);

            tool = new TownBorderPlayerTool(service);
        }
 public TownBorderPlayerTool(TownCenterService townCenterService)
 {
     this.townCenterService = townCenterService;
 }
 public TownBorderTool(TownCenterService townCenterService)
     : base("TownBorderTool", p => new TownBorderPlayerTool(townCenterService))
 {
 }