- Variable interest rates with GUI (and with economy integration)
- Three types of loans
- Short loan 60% equity 1 or 2 years high interest downpay
- Mortagage 150% equity LifeLong medium interest
- Investment 500% equity LifeLong low interest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------ ADD SNOW | |
layers = tonumber(layers) | |
-- Transform to world parallelogram | |
local x,z, widthX,widthZ, heightX,heightZ = Utils.getXZWidthAndHeight(g_currentMission.terrainDetailHeightId, startWorldX, startWorldZ, widthWorldX, widthWorldZ, heightWorldX, heightWorldZ) | |
if self.snowMaskId ~= nil then | |
-- Set snow type where we have no other heaps or masked areas on the map. | |
-- Set mask for the target density map: the current value should be 0 (not existent). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadMap() | |
if server then | |
self.data = {["temperature"]={},["rain"]={}} | |
self:loadFromXML(defaultpath) | |
if mod file exists then | |
self:loadFromXML(mod file path) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local i = 0 | |
while true do | |
local key = string.format("bla.gt(%i)", i) | |
if not hasXMLKey(file, key) then | |
break | |
end | |
-- Get the values here using key.."#val" | |
i = i + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return x() | |
.then(() => y()) | |
.catch(() => { | |
return a() | |
.then(() => b()); | |
}); | |
EQUALS | |
return x() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
All resources are accessed using SPhereFS protocol | |
Default root is ~sgm/ | |
If / is not prefixed, it is implied | |
/ equals to ~sgm/ | |
I want: | |
./ or ../ to start from current file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Game { | |
constructor() { | |
assert(false && "Can't create another Game object"); | |
} | |
get name() { | |
return "MyGame"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function logClass(targetClass: any): () => void { | |
let originalClass = targetClass; | |
// Function to create new instances of a class. | |
function construct(constructor: Function, args: any[]): any { | |
let cls = function(): void { | |
return constructor.apply(this, args); | |
}; | |
cls.prototype = constructor.prototype; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function unwrapAsyncValue<T>(value: any, cb: (_err: any, _value: T) => void): void { | |
Promise.join(value, (unwrappedValue: any) => { | |
if (typeof unwrappedValue === "function") { | |
unwrappedValue(cb); | |
} else { | |
cb(null, unwrappedValue); | |
} | |
}).catch((err: Error) => cb(err, null)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Small explanation: first, watch this in a way you can see 1 line in full length, else it is unreadable. | |
* 'create client' is a message from pool.connect() in pool.js, after pool.acquire has been called. Here i set a variable to the client, called ___key,with a small text and the current date. This is to recognize the client. | |
* Then you see messages from the generic pool: they are from the ide remover, that is scheduled when a client is inside the pool (not used). At the end of the functon, if number of client in the pool > 0, it reschedules, otherwise, it does not reschedule. | |
* Then it figures the client has timed out (timeout here being the pool timeout, defined in the configuration. I put it very very fast in order to be able to test this reasonably. (reap 500ms, idle timeout 10s). | |
* 'ended' is in pool.destroy() (factory). It will then set _destroying to true and poolCount to undefined, and call client.end() (stream). | |
* generic pool tells us that all clients are removed (correctly so). | |
* Then the error come |
NewerOlder