Initial commit - full huishou project

This commit is contained in:
jiapengyu
2026-07-27 14:07:26 +08:00
commit 60790ad1b3
39127 changed files with 5989265 additions and 0 deletions
@@ -0,0 +1 @@
ref: refs/heads/master
@@ -0,0 +1,7 @@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
@@ -0,0 +1 @@
Unnamed repository; edit this file 'description' to name the repository.
Binary file not shown.
@@ -0,0 +1 @@
60e3f7b244a5305e2c9fa4ef0e897f3b14f3b8dd refs/heads/master
@@ -0,0 +1,2 @@
P pack-1652578900ac63564f2a24b9714529821276ceb9.pack
@@ -0,0 +1,2 @@
# pack-refs with: peeled fully-peeled
60e3f7b244a5305e2c9fa4ef0e897f3b14f3b8dd refs/heads/master
@@ -0,0 +1,41 @@
<html>
<body>
<h1 id="first section">
<ol>
<li>item 1.1</li>
<li>item 1.2 changed</li>
<li>item 1.3 changed</li>
<li>item 1.4</li>
<li>item 1.5</li>
<li>item 1.6</li>
<li>item 1.7</li>
<li>item 1.8</li>
<li>item 1.9</li>
<li>item 1.10 added</li>
</ol>
</h1>
<h1 id="second section">
<ol>
<li>item 2.1</li>
<li>item 2.2</li>
<li>item 2.3</li>
<li>item 2.4</li>
<li>item 2.5</li>
<li>item 2.6</li>
<li>item 2.7 changed</li>
<li>item 2.7.1 added</li>
<li>item 2.8</li>
</ol>
</h1>
<h1 id="third section">
<ol>
<li>item 3.1</li>
<li>item 3.2</li>
<li>item 3.3</li>
<li>item 3.4</li>
<li>item 3.5</li>
<li>item 3.6</li>
</ol>
</h1>
</body>
</html>
@@ -0,0 +1,108 @@
define(function(require, exports, module) {
module.exports = Player;
var Key = require("./key")
, Direction = require("./direction");
function Player(game) {
this.game = game;
this.image = new Image("./assets/fighter.png");
this.game.resources.add(this.image);
this.x = 0;
this.y = 0;
this.pixelX = 10;
this.pixelY = 10;
this.animationStep = 0;
}
Player.prototype.update = function() {
if (!this.isWalking()) {
this.handleInput();
}
if (this.isWalking()) {
// Increase the animation step.
this.animationStep = ++this.animationStep % 60;
if (this.x * 32 > this.pixelX) {
this.pixelX++;
} else if (this.x * 32 < this.pixelX) {
this.pixelX--;
}
if (this.y * 32 > this.pixelY) {
this.pixelY++;
} else if (this.y * 32 < this.pixelY) {
this.pixelY--;
}
} else {
// Reset the animation step.
this.animationStep = 0;
}
};
Player.prototype.handleInput = function() {
var keyboard = this.game.keyboard, finalAction, action, inputs = {
'moveDown': keyboard.isDown(Key.DOWN),
'moveUp': keyboard.isDown(Key.UP),
'moveLeft': keyboard.isDown(Key.LEFT),
'moveRight': keyboard.isDown(Key.RIGHT)
};
for (action in inputs) {
if (inputs[action]) {
if (!finalAction || inputs[finalAction] < inputs[action]) {
finalAction = action;
}
}
}
this[finalAction] && this[finalAction]();
};
Player.prototype.isWalking = function() {
return this.x * 32 != this.pixelX || this.y * 32 != this.pixelY;
};
Player.prototype.moveDown = function() {
this.y += 1;
this.direction = Direction.DOWN;
};
Player.prototype.moveUp = function() {
this.y -= 1;
this.direction = Direction.UP;
};
Player.prototype.moveLeft = function() {
this.x -= 5;
this.direction = Direction.LEFT;
};
Player.prototype.moveRight = function() {
this.x += 1;
this.direction = Direction.RIGHT;
};
Player.prototype.draw = function(context) {
var offsetX = Math.floor(this.animationStep / 15) * 32, offsetY = 0;
switch(this.direction) {
case Direction.UP:
offsetY = 48 * 3;
break;
case Direction.RIGHT:
offsetY = 48 * 2;
break;
case Direction.LEFT:
offsetY = 48;
break;
}
context.drawImage(this.image.data, offsetX, offsetY, 32, 48, this.pixelX, this.pixelY, 32, 48);
};
});
@@ -0,0 +1,50 @@
<?php
namespace Faker;
/**
* Proxy for other generators, to return only unique values. Works with
* Faker\Generator\Base->unique()
*/
class UniqueGenerator
{
protected $generator;
protected $maxRetries;
protected $moreStuff;
protected $uniques = array();
public function __construct(Generator $generator, $maxRetries)
{
$this->generator = $generator;
$this->maxRetries = $maxRetries + 1;
}
/**
* Catch and proxy all generator calls but return only unique values
*/
public function __get($attribute)
{
return $this->__call($attribute, array());
}
/**
* Catch and proxy all generator calls with arguments but return only unique values
*/
public function __call($name, $arguments)
{
$i = 0;
if (!isset($this->uniques[$name])) {
$this->uniques[$name] = array();
}
do {
$res = call_user_func_array(array($this->generator, $name), $arguments);
$i++;
if ($i >= $this->maxRetries) {
throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a unique value', $this->maxRetries));
}
} while (in_array($res, $this->uniques[$name]));
$this->uniques[$name][]= $res;
return $res;
}
}
@@ -0,0 +1,41 @@
<html>
<body>
<h1 id="first section">
<ol>
<li>item 1.1</li>
<li>item 1.2</li>
<li>item 1.3</li>
<li>item 1.4</li>
<li>item 1.5</li>
<li>item 1.6</li>
<li>item 1.7</li>
<li>item 1.8</li>
<li>item 1.9</li>
</ol>
</h1>
<h1 id="second section">
<ol>
<li>item 2.1</li>
<li>item 2.2</li>
<li>item 2.3</li>
<li>item 2.4</li>
<li>item 2.5</li>
<li>item 2.6</li>
<li>item 2.7</li>
<li>item 2.8</li>
</ol>
</h1>
<h1 id="third section">
<ol>
<li>item 3.1</li>
<li>item 3.2</li>
<li>item 3.3</li>
<li>item 3.4</li>
<li>item 3.5</li>
<li>item 3.6</li>
<li>item 3.7</li>
<li>item 3.8</li>
</ol>
</h1>
</body>
</html>
@@ -0,0 +1,109 @@
define(function(require, exports, module) {
module.exports = Player;
var Key = require("./key")
, Direction = require("./direction")
, Image = require("./image");
function Player(game) {
this.game = game;
this.image = new Image("./assets/fighter.png");
this.game.resources.add(this.image);
this.x = 0;
this.y = 0;
this.pixelX = 0;
this.pixelY = 0;
this.animationStep = 0;
}
Player.prototype.update = function() {
if (!this.isWalking()) {
this.handleInput();
}
if (this.isWalking()) {
// Increase the animation step.
this.animationStep = ++this.animationStep % 60;
if (this.x * 32 > this.pixelX) {
this.pixelX++;
} else if (this.x * 32 < this.pixelX) {
this.pixelX--;
}
if (this.y * 32 > this.pixelY) {
this.pixelY++;
} else if (this.y * 32 < this.pixelY) {
this.pixelY--;
}
} else {
// Reset the animation step.
this.animationStep = 0;
}
};
Player.prototype.handleInput = function() {
var keyboard = this.game.keyboard, finalAction, action, inputs = {
'moveDown': keyboard.isDown(Key.DOWN),
'moveUp': keyboard.isDown(Key.UP),
'moveLeft': keyboard.isDown(Key.LEFT),
'moveRight': keyboard.isDown(Key.RIGHT)
};
for (action in inputs) {
if (inputs[action]) {
if (!finalAction || inputs[finalAction] < inputs[action]) {
finalAction = action;
}
}
}
this[finalAction] && this[finalAction]();
};
Player.prototype.isWalking = function() {
return this.x * 32 != this.pixelX || this.y * 32 != this.pixelY;
};
Player.prototype.moveDown = function() {
this.y += 1;
this.direction = Direction.DOWN;
};
Player.prototype.moveUp = function() {
this.y -= 1;
this.direction = Direction.UP;
};
Player.prototype.moveLeft = function() {
this.x -= 1;
this.direction = Direction.LEFT;
};
Player.prototype.moveRight = function() {
this.x += 1;
this.direction = Direction.RIGHT;
};
Player.prototype.draw = function(context) {
var offsetX = Math.floor(this.animationStep / 15) * 32, offsetY = 0;
switch(this.direction) {
case Direction.UP:
offsetY = 48 * 3;
break;
case Direction.RIGHT:
offsetY = 48 * 2;
break;
case Direction.LEFT:
offsetY = 48;
break;
}
context.drawImage(this.image.data, offsetX, offsetY, 32, 48, this.pixelX, this.pixelY - 16, 32, 48);
};
});
@@ -0,0 +1,49 @@
<?php
namespace Faker;
/**
* Proxy for other generators, to return only unique values. Works with
* Faker\Generator\Base->unique()
*/
class UniqueGenerator
{
protected $generator;
protected $maxRetries;
protected $uniques = array();
public function __construct(Generator $generator, $maxRetries)
{
$this->generator = $generator;
$this->maxRetries = $maxRetries;
}
/**
* Catch and proxy all generator calls but return only unique values
*/
public function __get($attribute)
{
return $this->__call($attribute, array());
}
/**
* Catch and proxy all generator calls with arguments but return only unique values
*/
public function __call($name, $arguments)
{
if (!isset($this->uniques[$name])) {
$this->uniques[$name] = array();
}
$i = 0;
do {
$res = call_user_func_array(array($this->generator, $name), $arguments);
$i++;
if ($i > $this->maxRetries) {
throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a unique value', $this->maxRetries));
}
} while (in_array($res, $this->uniques[$name]));
$this->uniques[$name][]= $res;
return $res;
}
}
@@ -0,0 +1,26 @@
diff --git a/files/file.html b/files/file.html
index 872d196..2320e2f 100644
--- a/files/file.html
+++ b/files/file.html
@@ -5,4 +5,4 @@ <h1 id="first section">
<li>item 1.1</li>
- <li>item 1.2</li>
- <li>item 1.3</li>
+ <li>item 1.2 changed</li>
+ <li>item 1.3 changed</li>
<li>item 1.4</li>
@@ -13,2 +13,3 @@ <h1 id="first section">
<li>item 1.9</li>
+ <li>item 1.10 added</li>
</ol>
@@ -23,3 +24,4 @@ <h1 id="second section">
<li>item 2.6</li>
- <li>item 2.7</li>
+ <li>item 2.7 changed</li>
+ <li>item 2.7.1 added</li>
<li>item 2.8</li>
@@ -35,4 +37,2 @@ <h1 id="third section">
<li>item 3.6</li>
- <li>item 3.7</li>
- <li>item 3.8</li>
</ol>
@@ -0,0 +1,27 @@
diff --git a/files/file.javascript b/files/file.javascript
index 0965b37..5391797 100644
--- a/files/file.javascript
+++ b/files/file.javascript
@@ -4,4 +4,3 @@ function(require, exports, module)
var Key = require("./key")
- , Direction = require("./direction")
- , Image = require("./image");
+ , Direction = require("./direction");
@@ -16,4 +15,4 @@ function Player(game)
- this.pixelX = 0;
- this.pixelY = 0;
+ this.pixelX = 10;
+ this.pixelY = 10;
@@ -82,3 +81,3 @@ Player.prototype.moveUp = function()
Player.prototype.moveLeft = function() {
- this.x -= 1;
+ this.x -= 5;
this.direction = Direction.LEFT;
@@ -106,3 +105,3 @@ Player.prototype.draw = function(context)
- context.drawImage(this.image.data, offsetX, offsetY, 32, 48, this.pixelX, this.pixelY - 16, 32, 48);
+ context.drawImage(this.image.data, offsetX, offsetY, 32, 48, this.pixelX, this.pixelY, 32, 48);
};
@@ -0,0 +1,26 @@
diff --git a/files/file.php b/files/file.php
index 63250ad..967d646 100644
--- a/files/file.php
+++ b/files/file.php
@@ -12,2 +12,3 @@ class UniqueGenerator
protected $maxRetries;
+ protected $moreStuff;
protected $uniques = array();
@@ -17,3 +18,3 @@ public function __construct(Generator $generator, $maxRetries)
$this->generator = $generator;
- $this->maxRetries = $maxRetries;
+ $this->maxRetries = $maxRetries + 1;
}
@@ -33,10 +34,10 @@ public function __call($name, $arguments)
{
+ $i = 0;
if (!isset($this->uniques[$name])) {
$this->uniques[$name] = array();
}
- $i = 0;
do {
$res = call_user_func_array(array($this->generator, $name), $arguments);
$i++;
- if ($i > $this->maxRetries) {
+ if ($i >= $this->maxRetries) {
throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a unique value', $this->maxRetries));
@@ -0,0 +1,26 @@
diff --git a/files/file.html b/files/file.html
index 872d196..2320e2f 100644
--- a/files/file.html
+++ b/files/file.html
@@ -5,4 +5,4 @@
<li>item 1.1</li>
- <li>item 1.2</li>
- <li>item 1.3</li>
+ <li>item 1.2 changed</li>
+ <li>item 1.3 changed</li>
<li>item 1.4</li>
@@ -13,2 +13,3 @@
<li>item 1.9</li>
+ <li>item 1.10 added</li>
</ol>
@@ -23,3 +24,4 @@
<li>item 2.6</li>
- <li>item 2.7</li>
+ <li>item 2.7 changed</li>
+ <li>item 2.7.1 added</li>
<li>item 2.8</li>
@@ -35,4 +37,2 @@
<li>item 3.6</li>
- <li>item 3.7</li>
- <li>item 3.8</li>
</ol>
@@ -0,0 +1,27 @@
diff --git a/files/file.javascript b/files/file.javascript
index 0965b37..5391797 100644
--- a/files/file.javascript
+++ b/files/file.javascript
@@ -4,4 +4,3 @@ define(function(require, exports, module) {
var Key = require("./key")
- , Direction = require("./direction")
- , Image = require("./image");
+ , Direction = require("./direction");
@@ -16,4 +15,4 @@ define(function(require, exports, module) {
- this.pixelX = 0;
- this.pixelY = 0;
+ this.pixelX = 10;
+ this.pixelY = 10;
@@ -82,3 +81,3 @@ define(function(require, exports, module) {
Player.prototype.moveLeft = function() {
- this.x -= 1;
+ this.x -= 5;
this.direction = Direction.LEFT;
@@ -106,3 +105,3 @@ define(function(require, exports, module) {
- context.drawImage(this.image.data, offsetX, offsetY, 32, 48, this.pixelX, this.pixelY - 16, 32, 48);
+ context.drawImage(this.image.data, offsetX, offsetY, 32, 48, this.pixelX, this.pixelY, 32, 48);
};
@@ -0,0 +1,26 @@
diff --git a/files/file.php b/files/file.php
index 63250ad..967d646 100644
--- a/files/file.php
+++ b/files/file.php
@@ -12,2 +12,3 @@ class UniqueGenerator
protected $maxRetries;
+ protected $moreStuff;
protected $uniques = array();
@@ -17,3 +18,3 @@ class UniqueGenerator
$this->generator = $generator;
- $this->maxRetries = $maxRetries;
+ $this->maxRetries = $maxRetries + 1;
}
@@ -33,10 +34,10 @@ class UniqueGenerator
{
+ $i = 0;
if (!isset($this->uniques[$name])) {
$this->uniques[$name] = array();
}
- $i = 0;
do {
$res = call_user_func_array(array($this->generator, $name), $arguments);
$i++;
- if ($i > $this->maxRetries) {
+ if ($i >= $this->maxRetries) {
throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a unique value', $this->maxRetries));
@@ -0,0 +1,41 @@
<html>
<body>
<h1 id="first section">
<ol>
<li>item 1.1</li>
<li>item 1.2 changed</li>
<li>item 1.3 changed</li>
<li>item 1.4</li>
<li>item 1.5</li>
<li>item 1.6</li>
<li>item 1.7</li>
<li>item 1.8</li>
<li>item 1.9</li>
<li>item 1.10 added</li>
</ol>
</h1>
<h1 id="second section">
<ol>
<li>item 2.1</li>
<li>item 2.2</li>
<li>item 2.3</li>
<li>item 2.4</li>
<li>item 2.5</li>
<li>item 2.6</li>
<li>item 2.7 changed</li>
<li>item 2.7.1 added</li>
<li>item 2.8</li>
</ol>
</h1>
<h1 id="third section">
<ol>
<li>item 3.1</li>
<li>item 3.2</li>
<li>item 3.3</li>
<li>item 3.4</li>
<li>item 3.5</li>
<li>item 3.6</li>
</ol>
</h1>
</body>
</html>
@@ -0,0 +1,108 @@
define(function(require, exports, module) {
module.exports = Player;
var Key = require("./key")
, Direction = require("./direction");
function Player(game) {
this.game = game;
this.image = new Image("./assets/fighter.png");
this.game.resources.add(this.image);
this.x = 0;
this.y = 0;
this.pixelX = 10;
this.pixelY = 10;
this.animationStep = 0;
}
Player.prototype.update = function() {
if (!this.isWalking()) {
this.handleInput();
}
if (this.isWalking()) {
// Increase the animation step.
this.animationStep = ++this.animationStep % 60;
if (this.x * 32 > this.pixelX) {
this.pixelX++;
} else if (this.x * 32 < this.pixelX) {
this.pixelX--;
}
if (this.y * 32 > this.pixelY) {
this.pixelY++;
} else if (this.y * 32 < this.pixelY) {
this.pixelY--;
}
} else {
// Reset the animation step.
this.animationStep = 0;
}
};
Player.prototype.handleInput = function() {
var keyboard = this.game.keyboard, finalAction, action, inputs = {
'moveDown': keyboard.isDown(Key.DOWN),
'moveUp': keyboard.isDown(Key.UP),
'moveLeft': keyboard.isDown(Key.LEFT),
'moveRight': keyboard.isDown(Key.RIGHT)
};
for (action in inputs) {
if (inputs[action]) {
if (!finalAction || inputs[finalAction] < inputs[action]) {
finalAction = action;
}
}
}
this[finalAction] && this[finalAction]();
};
Player.prototype.isWalking = function() {
return this.x * 32 != this.pixelX || this.y * 32 != this.pixelY;
};
Player.prototype.moveDown = function() {
this.y += 1;
this.direction = Direction.DOWN;
};
Player.prototype.moveUp = function() {
this.y -= 1;
this.direction = Direction.UP;
};
Player.prototype.moveLeft = function() {
this.x -= 5;
this.direction = Direction.LEFT;
};
Player.prototype.moveRight = function() {
this.x += 1;
this.direction = Direction.RIGHT;
};
Player.prototype.draw = function(context) {
var offsetX = Math.floor(this.animationStep / 15) * 32, offsetY = 0;
switch(this.direction) {
case Direction.UP:
offsetY = 48 * 3;
break;
case Direction.RIGHT:
offsetY = 48 * 2;
break;
case Direction.LEFT:
offsetY = 48;
break;
}
context.drawImage(this.image.data, offsetX, offsetY, 32, 48, this.pixelX, this.pixelY, 32, 48);
};
});
@@ -0,0 +1,50 @@
<?php
namespace Faker;
/**
* Proxy for other generators, to return only unique values. Works with
* Faker\Generator\Base->unique()
*/
class UniqueGenerator
{
protected $generator;
protected $maxRetries;
protected $moreStuff;
protected $uniques = array();
public function __construct(Generator $generator, $maxRetries)
{
$this->generator = $generator;
$this->maxRetries = $maxRetries + 1;
}
/**
* Catch and proxy all generator calls but return only unique values
*/
public function __get($attribute)
{
return $this->__call($attribute, array());
}
/**
* Catch and proxy all generator calls with arguments but return only unique values
*/
public function __call($name, $arguments)
{
$i = 0;
if (!isset($this->uniques[$name])) {
$this->uniques[$name] = array();
}
do {
$res = call_user_func_array(array($this->generator, $name), $arguments);
$i++;
if ($i >= $this->maxRetries) {
throw new \OverflowException(sprintf('Maximum retries of %d reached without finding a unique value', $this->maxRetries));
}
} while (in_array($res, $this->uniques[$name]));
$this->uniques[$name][]= $res;
return $res;
}
}