monopoly-shared-model
Version:
Shared model for Monopoly
58 lines • 1.67 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Serializable_1 = require("../Serializable");
const crypto_1 = require("crypto");
class Log extends Serializable_1.Serializable {
constructor(index, timestamp, level, content, transactionId, currentGameIndex, playerName, chaincode) {
super();
this.index = index;
this.timestamp = timestamp;
this.level = level;
this.content = content;
this.transactionId = transactionId;
this.currentGameIndex = currentGameIndex;
this.playerName = playerName;
this.chaincode = chaincode;
}
getLevel() {
return this.level;
}
getContent() {
return this.content;
}
getIndex() {
return this.index;
}
getTimestamp() {
return this.timestamp;
}
getTransactionId() {
return this.transactionId;
}
getCurrentGameIndex() {
return this.currentGameIndex;
}
getPlayerName() {
return this.playerName;
}
getChaincode() {
return this.chaincode;
}
static emptyObject() {
return new Log(null, null, null, null, null, null, null, null);
}
generateHashKey() {
return crypto_1.createHash('md5')
.update(this.index.toString())
.update(this.timestamp)
.update(this.level)
.update(this.content)
.update(this.transactionId)
.update(this.currentGameIndex.toString())
.update(this.playerName)
.update(this.chaincode)
.digest('hex');
}
}
exports.Log = Log;
//# sourceMappingURL=Log.js.map