Renamed to soft hash

This commit is contained in:
Willem Cazander 2022-02-23 17:16:54 +01:00
parent 0c906b701f
commit 5dc311c93e
5 changed files with 20 additions and 20 deletions

View file

@ -8,19 +8,19 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class WaterShot {
private List<WaterShotHash> shotHashes = new ArrayList<>();
private List<WaterSoftHash> softHashes = new ArrayList<>();
public List<WaterShotHash> getShotHashes() {
return shotHashes;
public List<WaterSoftHash> getSoftHashes() {
return softHashes;
}
public void setShotHashes(List<WaterShotHash> shotHashes) {
for (WaterShotHash hash:shotHashes) {
addShotHash(hash);
public void setSoftHashes(List<WaterSoftHash> shotHashes) {
for (WaterSoftHash hash:shotHashes) {
addSoftHash(hash);
}
}
public void addShotHash(WaterShotHash shotHash) {
this.shotHashes.add(shotHash);
public void addSoftHash(WaterSoftHash softHash) {
this.softHashes.add(softHash);
}
}

View file

@ -22,7 +22,7 @@ public class WaterShotAddict {
return false;
}
WaterShot waterShot = WaterShotDriver.newInstance().createReader().readFile(fileWarpHash);
for (WaterShotHash hash:waterShot.getShotHashes()) {
for (WaterSoftHash hash:waterShot.getSoftHashes()) {
File checkFile = new File(folder, hash.getFile());
if (!checkFile.exists()) {
return false;
@ -38,7 +38,7 @@ public class WaterShotAddict {
public void updateWarpHashes(File folder) throws FileNotFoundException, X4OConnectionException, SAXException, IOException, NoSuchAlgorithmException {
File fileWarpHash = new File(folder, Warpᵐᵉ.WARP_HASH);
WaterShot waterShot = WaterShotDriver.newInstance().createReader().readFile(fileWarpHash);
for (WaterShotHash hash:waterShot.getShotHashes()) {
for (WaterSoftHash hash:waterShot.getSoftHashes()) {
hash.setHex(calcHashInHex(new File(folder, hash.getFile())));
}
WaterShotDriver.newInstance().createWriter().writeFile(waterShot, fileWarpHash);

View file

@ -3,15 +3,15 @@ package love.distributedrebirth.warpme.hash;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class WaterShotHash {
public class WaterSoftHash {
private String file;
private String hex;
public WaterShotHash() {
public WaterSoftHash() {
}
public WaterShotHash(String file, String hex) {
public WaterSoftHash(String file, String hex) {
setFile(file);
setHex(hex);
}

View file

@ -7,10 +7,10 @@
providerHost="warp-hash.x4o.distributedrebirth.love" providerName="WarpHashᵐᵉ"
id="warp-hash-module">
<eld:classBindingHandler id="WaterShot-WaterShotHash"
<eld:classBindingHandler id="WaterShot-WaterSoftHash"
parentClass="love.distributedrebirth.warpme.hash.WaterShot"
childClass="love.distributedrebirth.warpme.hash.WaterShotHash"
addMethod="addShotHash" getMethod="getShotHashes" />
childClass="love.distributedrebirth.warpme.hash.WaterSoftHash"
addMethod="addSoftHash" getMethod="getSoftHashes" />
<eld:namespace
uri="http://wrap-core.x4o.distributedrebirth.love/xml/ns/warp-hash-root"
@ -29,6 +29,6 @@
description="Language namespace to store warp hash"
name="WarpHash Language Namespace" id="soft">
<eld:element tag="hash"
objectClass="love.distributedrebirth.warpme.hash.WaterShotHash" />
objectClass="love.distributedrebirth.warpme.hash.WaterSoftHash" />
</eld:namespace>
</root:module>

View file

@ -17,10 +17,10 @@ public class WaterShotDriverTest {
public void testWaterShot() throws X4OConnectionException, SAXException, IOException {
WaterShot drugs = new WaterShot();
drugs.addShotHash(new WaterShotHash("test.txt", "234SDFSDF234234SDFSDF234"));
drugs.addShotHash(new WaterShotHash("test2.txt", "ASDFYYF234234SDFSDFASDFS"));
drugs.addSoftHash(new WaterSoftHash("test.txt", "234SDFSDF234234SDFSDF234"));
drugs.addSoftHash(new WaterSoftHash("test2.txt", "ASDFYYF234234SDFSDFASDFS"));
Assertions.assertNotNull(drugs);
//WaterShotDriver.newInstance().createWriter().writeFile(drugs, new File("build/output.xml"));
WaterShotDriver.newInstance().createWriter().writeFile(drugs, new java.io.File("build/output.xml"));
}
}