Advertisement
Guest User

Untitled

a guest
Jun 1st, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 1.16 KB | None | 0 0
  1. Beatmap.hx
  2. class Beatmap
  3. {
  4.     public var BPM:Float;
  5.     public var tick:Float;
  6.     public var prepareTime:Float;
  7.     public var notes:Array;
  8.     public var name:String;
  9.     public var author:String;
  10.     public var creator:String;
  11.    
  12.     public function new(name:String, author:String, creator:String, newBPM:Float, prepareTime:Float, notes:Array)
  13.     {
  14.         setBPM(newBPM);
  15.         this.notes = notes;
  16.         this.prepareTime = prepareTime;
  17.     }
  18.     public function setBPM(newBPM:Float) {
  19.         BPM = newBPM;
  20.         tick = BPM / 60;
  21.     }
  22. }
  23.  
  24. BeatmapParser.hx
  25. class BeatmapParser
  26. {
  27.     public static function parse(path:String):Beatmap {
  28.         var notes;
  29.         var text:String = Assets.getText("data/" + path + "/notes.txt");
  30.         var confs:String = Assets.getText("data/" + path + "/config.txt");
  31.         var conf = confs.split("\n");
  32.         notes = Reader.parseCsv(text, ":");
  33.         trace(notes);
  34.         return new Beatmap(conf[2], conf[1], conf[0], Std.parseFloat(conf[3]), Std.parseFloat(conf[4]), notes);
  35.     }
  36. }
  37.  
  38. Error:
  39. source/tk/castit/arrows/BeatmapParser.hx:18: characters 9-104 : tk.castit.arrows.Beatmap does not have a constructor
  40. source/tk/castit/arrows/BeatmapParser.hx:11: lines 11-19 : Missing return tk.castit.arrows.Beatmap
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement