From 86228a960cdbfb85c70d4ef1f1f4fc6752a5fd00 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Sun, 20 Aug 2023 18:14:40 +0700 Subject: [PATCH] Add signal classes for `CommandAPI` --- .../CommandsAPI_OnCommandAdded_Signal.uc | 39 +++++++++++++++++++ .../Events/CommandsAPI_OnCommandAdded_Slot.uc | 38 ++++++++++++++++++ .../CommandsAPI_OnCommandRemoved_Signal.uc | 39 +++++++++++++++++++ .../CommandsAPI_OnCommandRemoved_Slot.uc | 38 ++++++++++++++++++ .../CommandsAPI_OnVotingAdded_Signal.uc | 39 +++++++++++++++++++ .../Events/CommandsAPI_OnVotingAdded_Slot.uc | 38 ++++++++++++++++++ .../CommandsAPI_OnVotingEnded_Signal.uc | 39 +++++++++++++++++++ .../Events/CommandsAPI_OnVotingEnded_Slot.uc | 38 ++++++++++++++++++ .../CommandsAPI_OnVotingRemoved_Signal.uc | 39 +++++++++++++++++++ .../CommandsAPI_OnVotingRemoved_Slot.uc | 38 ++++++++++++++++++ 10 files changed, 385 insertions(+) create mode 100644 sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandAdded_Signal.uc create mode 100644 sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandAdded_Slot.uc create mode 100644 sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandRemoved_Signal.uc create mode 100644 sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandRemoved_Slot.uc create mode 100644 sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingAdded_Signal.uc create mode 100644 sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingAdded_Slot.uc create mode 100644 sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingEnded_Signal.uc create mode 100644 sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingEnded_Slot.uc create mode 100644 sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingRemoved_Signal.uc create mode 100644 sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingRemoved_Slot.uc diff --git a/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandAdded_Signal.uc b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandAdded_Signal.uc new file mode 100644 index 0000000..d17dd11 --- /dev/null +++ b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandAdded_Signal.uc @@ -0,0 +1,39 @@ +/** + * Author: dkanus + * Home repo: https://www.insultplayers.ru/git/AcediaFramework/AcediaCore + * License: GPL + * Copyright 2023 Anton Tarasenko + *------------------------------------------------------------------------------ + * This file is part of Acedia. + * + * Acedia is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License, or + * (at your option) any later version. + * + * Acedia is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Acedia. If not, see . + */ +class CommandsAPI_OnCommandAdded_Signal extends Signal; + +public final function bool Emit(class addedClass, Text usedName) { + local Slot nextSlot; + + StartIterating(); + nextSlot = GetNextSlot(); + while (nextSlot != none) { + CommandsAPI_OnCommandAdded_Slot(nextSlot).connect(addedClass, usedName); + nextSlot = GetNextSlot(); + } + CleanEmptySlots(); + return true; +} + +defaultproperties { + relatedSlotClass = class'CommandsAPI_OnCommandAdded_Slot' +} \ No newline at end of file diff --git a/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandAdded_Slot.uc b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandAdded_Slot.uc new file mode 100644 index 0000000..9d9f351 --- /dev/null +++ b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandAdded_Slot.uc @@ -0,0 +1,38 @@ +/** + * Author: dkanus + * Home repo: https://www.insultplayers.ru/git/AcediaFramework/AcediaCore + * License: GPL + * Copyright 2023 Anton Tarasenko + *------------------------------------------------------------------------------ + * This file is part of Acedia. + * + * Acedia is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License, or + * (at your option) any later version. + * + * Acedia is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Acedia. If not, see . + */ +class CommandsAPI_OnCommandAdded_Slot extends Slot; + +delegate connect(class addedClass, Text usedName) { + DummyCall(); +} + +protected function Constructor() { + connect = none; +} + +protected function Finalizer() { + super.Finalizer(); + connect = none; +} + +defaultproperties { +} \ No newline at end of file diff --git a/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandRemoved_Signal.uc b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandRemoved_Signal.uc new file mode 100644 index 0000000..3bb522b --- /dev/null +++ b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandRemoved_Signal.uc @@ -0,0 +1,39 @@ +/** + * Author: dkanus + * Home repo: https://www.insultplayers.ru/git/AcediaFramework/AcediaCore + * License: GPL + * Copyright 2023 Anton Tarasenko + *------------------------------------------------------------------------------ + * This file is part of Acedia. + * + * Acedia is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License, or + * (at your option) any later version. + * + * Acedia is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Acedia. If not, see . + */ +class CommandsAPI_OnCommandRemoved_Signal extends Signal; + +public final function bool Emit(class removedClass) { + local Slot nextSlot; + + StartIterating(); + nextSlot = GetNextSlot(); + while (nextSlot != none) { + CommandsAPI_OnCommandRemoved_Slot(nextSlot).connect(removedClass); + nextSlot = GetNextSlot(); + } + CleanEmptySlots(); + return true; +} + +defaultproperties { + relatedSlotClass = class'CommandsAPI_OnCommandRemoved_Slot' +} \ No newline at end of file diff --git a/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandRemoved_Slot.uc b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandRemoved_Slot.uc new file mode 100644 index 0000000..2b12c9e --- /dev/null +++ b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnCommandRemoved_Slot.uc @@ -0,0 +1,38 @@ +/** + * Author: dkanus + * Home repo: https://www.insultplayers.ru/git/AcediaFramework/AcediaCore + * License: GPL + * Copyright 2023 Anton Tarasenko + *------------------------------------------------------------------------------ + * This file is part of Acedia. + * + * Acedia is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License, or + * (at your option) any later version. + * + * Acedia is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Acedia. If not, see . + */ +class CommandsAPI_OnCommandRemoved_Slot extends Slot; + +delegate connect(class removedClass) { + DummyCall(); +} + +protected function Constructor() { + connect = none; +} + +protected function Finalizer() { + super.Finalizer(); + connect = none; +} + +defaultproperties { +} \ No newline at end of file diff --git a/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingAdded_Signal.uc b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingAdded_Signal.uc new file mode 100644 index 0000000..874ea5c --- /dev/null +++ b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingAdded_Signal.uc @@ -0,0 +1,39 @@ +/** + * Author: dkanus + * Home repo: https://www.insultplayers.ru/git/AcediaFramework/AcediaCore + * License: GPL + * Copyright 2023 Anton Tarasenko + *------------------------------------------------------------------------------ + * This file is part of Acedia. + * + * Acedia is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License, or + * (at your option) any later version. + * + * Acedia is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Acedia. If not, see . + */ +class CommandsAPI_OnVotingAdded_Signal extends Signal; + +public final function bool Emit(class addedClass, Text usedName) { + local Slot nextSlot; + + StartIterating(); + nextSlot = GetNextSlot(); + while (nextSlot != none) { + CommandsAPI_OnVotingAdded_Slot(nextSlot).connect(addedClass, usedName); + nextSlot = GetNextSlot(); + } + CleanEmptySlots(); + return true; +} + +defaultproperties { + relatedSlotClass = class'CommandsAPI_OnVotingAdded_Slot' +} \ No newline at end of file diff --git a/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingAdded_Slot.uc b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingAdded_Slot.uc new file mode 100644 index 0000000..3093eb3 --- /dev/null +++ b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingAdded_Slot.uc @@ -0,0 +1,38 @@ +/** + * Author: dkanus + * Home repo: https://www.insultplayers.ru/git/AcediaFramework/AcediaCore + * License: GPL + * Copyright 2023 Anton Tarasenko + *------------------------------------------------------------------------------ + * This file is part of Acedia. + * + * Acedia is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License, or + * (at your option) any later version. + * + * Acedia is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Acedia. If not, see . + */ +class CommandsAPI_OnVotingAdded_Slot extends Slot; + +delegate connect(class addedClass, Text usedName) { + DummyCall(); +} + +protected function Constructor() { + connect = none; +} + +protected function Finalizer() { + super.Finalizer(); + connect = none; +} + +defaultproperties { +} \ No newline at end of file diff --git a/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingEnded_Signal.uc b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingEnded_Signal.uc new file mode 100644 index 0000000..ac6892d --- /dev/null +++ b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingEnded_Signal.uc @@ -0,0 +1,39 @@ +/** + * Author: dkanus + * Home repo: https://www.insultplayers.ru/git/AcediaFramework/AcediaCore + * License: GPL + * Copyright 2023 Anton Tarasenko + *------------------------------------------------------------------------------ + * This file is part of Acedia. + * + * Acedia is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License, or + * (at your option) any later version. + * + * Acedia is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Acedia. If not, see . + */ +class CommandsAPI_OnVotingEnded_Signal extends Signal; + +public final function bool Emit(bool success, HashTable arguments) { + local Slot nextSlot; + + StartIterating(); + nextSlot = GetNextSlot(); + while (nextSlot != none) { + CommandsAPI_OnVotingEnded_Slot(nextSlot).connect(success, arguments); + nextSlot = GetNextSlot(); + } + CleanEmptySlots(); + return true; +} + +defaultproperties { + relatedSlotClass = class'CommandsAPI_OnVotingEnded_Slot' +} \ No newline at end of file diff --git a/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingEnded_Slot.uc b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingEnded_Slot.uc new file mode 100644 index 0000000..6c737f3 --- /dev/null +++ b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingEnded_Slot.uc @@ -0,0 +1,38 @@ +/** + * Author: dkanus + * Home repo: https://www.insultplayers.ru/git/AcediaFramework/AcediaCore + * License: GPL + * Copyright 2023 Anton Tarasenko + *------------------------------------------------------------------------------ + * This file is part of Acedia. + * + * Acedia is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License, or + * (at your option) any later version. + * + * Acedia is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Acedia. If not, see . + */ +class CommandsAPI_OnVotingEnded_Slot extends Slot; + +delegate connect(bool success, HashTable arguments) { + DummyCall(); +} + +protected function Constructor() { + connect = none; +} + +protected function Finalizer() { + super.Finalizer(); + connect = none; +} + +defaultproperties { +} \ No newline at end of file diff --git a/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingRemoved_Signal.uc b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingRemoved_Signal.uc new file mode 100644 index 0000000..4728c96 --- /dev/null +++ b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingRemoved_Signal.uc @@ -0,0 +1,39 @@ +/** + * Author: dkanus + * Home repo: https://www.insultplayers.ru/git/AcediaFramework/AcediaCore + * License: GPL + * Copyright 2023 Anton Tarasenko + *------------------------------------------------------------------------------ + * This file is part of Acedia. + * + * Acedia is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License, or + * (at your option) any later version. + * + * Acedia is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Acedia. If not, see . + */ +class CommandsAPI_OnVotingRemoved_Signal extends Signal; + +public final function bool Emit(class removedClass) { + local Slot nextSlot; + + StartIterating(); + nextSlot = GetNextSlot(); + while (nextSlot != none) { + CommandsAPI_OnVotingRemoved_Slot(nextSlot).connect(removedClass); + nextSlot = GetNextSlot(); + } + CleanEmptySlots(); + return true; +} + +defaultproperties { + relatedSlotClass = class'CommandsAPI_OnVotingRemoved_Slot' +} \ No newline at end of file diff --git a/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingRemoved_Slot.uc b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingRemoved_Slot.uc new file mode 100644 index 0000000..28444ec --- /dev/null +++ b/sources/BaseAPI/API/Commands/Events/CommandsAPI_OnVotingRemoved_Slot.uc @@ -0,0 +1,38 @@ +/** + * Author: dkanus + * Home repo: https://www.insultplayers.ru/git/AcediaFramework/AcediaCore + * License: GPL + * Copyright 2023 Anton Tarasenko + *------------------------------------------------------------------------------ + * This file is part of Acedia. + * + * Acedia is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3 of the License, or + * (at your option) any later version. + * + * Acedia is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Acedia. If not, see . + */ +class CommandsAPI_OnVotingRemoved_Slot extends Slot; + +delegate connect(class removedClass) { + DummyCall(); +} + +protected function Constructor() { + connect = none; +} + +protected function Finalizer() { + super.Finalizer(); + connect = none; +} + +defaultproperties { +} \ No newline at end of file