-
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #407 from Quenty/users/quenty/misc
Users/quenty/misc
- Loading branch information
Showing
45 changed files
with
1,084 additions
and
410 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--[=[ | ||
@class CooldownServiceClient | ||
]=] | ||
|
||
local require = require(script.Parent.loader).load(script) | ||
|
||
local CooldownServiceClient = {} | ||
CooldownServiceClient.ServiceName = "CooldownServiceClient" | ||
|
||
function CooldownServiceClient:Init(serviceBag) | ||
assert(not self._serviceBag, "Already initialized") | ||
self._serviceBag = assert(serviceBag, "No serviceBag") | ||
|
||
-- External | ||
self._serviceBag:GetService(require("TimeSyncService")) | ||
|
||
-- Internal | ||
self._serviceBag:GetService(require("CooldownClient")) | ||
self._serviceBag:GetService(require("CooldownShared")) | ||
end | ||
|
||
return CooldownServiceClient |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--[=[ | ||
Represents a cooldown state with a time limit. See [CooldownBase] for more API. | ||
@server | ||
@class Cooldown | ||
]=] | ||
|
||
local require = require(script.Parent.loader).load(script) | ||
|
||
local CooldownBase = require("CooldownBase") | ||
local TimeSyncService = require("TimeSyncService") | ||
local CooldownConstants = require("CooldownConstants") | ||
local AttributeValue = require("AttributeValue") | ||
local Binder = require("Binder") | ||
local PropertyValue = require("PropertyValue") | ||
|
||
local Cooldown = setmetatable({}, CooldownBase) | ||
Cooldown.ClassName = "Cooldown" | ||
Cooldown.__index = Cooldown | ||
|
||
--[=[ | ||
Constructs a new cooldown. Should be done via [Binder]. | ||
@param numberValue NumberValue | ||
@param serviceBag ServiceBag | ||
@return Cooldown | ||
]=] | ||
function Cooldown.new(numberValue, serviceBag) | ||
local self = setmetatable(CooldownBase.new(numberValue, serviceBag), Cooldown) | ||
|
||
self._serviceBag = assert(serviceBag, "No serviceBag") | ||
self._syncedClock = self._serviceBag:GetService(TimeSyncService):GetSyncedClock() | ||
|
||
self._finishTime = PropertyValue.new(self._obj, "Value") | ||
self._startTime = AttributeValue.new(self._obj, CooldownConstants.COOLDOWN_START_TIME_ATTRIBUTE, self._syncedClock:GetTime()) | ||
|
||
self._maid:GiveTask(self.Done:Connect(function() | ||
self._obj:Remove() | ||
end)) | ||
|
||
return self | ||
end | ||
|
||
return Binder.new("Cooldown", Cooldown) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.