mirror of
https://github.com/kucherenko/jscpd.git
synced 2026-09-19 08:11:03 +08:00
64e471e2b0
Adds 92 new tests (178 → 270 total) with zero source-file modifications: - packages/finder: 13 new test files covering all reporters, subscribers, validators, hooks, utils, options, cloneFound, getFilesToDetect, and InFilesDetector; shared buildClone() factory helper - apps/jscpd: 3 new test files (options-unit, print, store) plus extensions to formats, modes, and options integration tests - vitest.config.ts added to both packages to restrict coverage.include to src/** only, eliminating bin/ and prism.js noise - Fixes 3 tokenizer bugs (trailing space in format lookup, tokenization edge cases) uncovered by the new format fixture suite - Adds fixture files for 40+ language formats to support formats.test.ts
39 lines
880 B
ActionScript
39 lines
880 B
ActionScript
package {
|
|
import flash.display.Sprite;
|
|
import flash.events.Event;
|
|
|
|
public class Player extends Sprite {
|
|
private var _name:String;
|
|
private var _score:int;
|
|
private var _level:int;
|
|
|
|
public function Player(name:String) {
|
|
_name = name;
|
|
_score = 0;
|
|
_level = 1;
|
|
}
|
|
|
|
public function get name():String {
|
|
return _name;
|
|
}
|
|
|
|
public function addScore(points:int):void {
|
|
_score += points;
|
|
trace("Score updated: " + _score);
|
|
if (_score >= _level * 100) {
|
|
levelUp();
|
|
}
|
|
}
|
|
|
|
public function get score():int {
|
|
return _score;
|
|
}
|
|
|
|
public function reset():void {
|
|
_score = 0;
|
|
_level = 1;
|
|
trace("Player reset: " + _name);
|
|
}
|
|
}
|
|
}
|