-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* `[Exiled::Core]` `Assets` and `Fragments` (#2568) * Core's assets have been implemented: - Added new classes and attributes for improved entity management. - Added AssetFragment, EClass, EntityAsset, and related attributes. - Any types implementing IAssetFragment can be used to generate a fragment or an EntityAsset. - Began adding EProperty attributes to classes which are supposed to be used to generate fragments and assets. * Implemented `EProperty` for Items * ?. * Minor changes to `EConfig`. Added an `EClass`. Converted `Effect` class to struct. * Added `Generator` `EClass` * Fix hint's `EClass` * Added more `EClass`'es * Fixed `AssetFragment::GenerateAsset` generating assets from types which are not marked as `EClass`. * Fixed `State` compare by ref instead of value * Minor fixes * All `EClass`'es * Fix warnings * Fix docs * Revert CustomHealthStat.cs * Fix build error * fix conflict? * fix typo * fix removals * fix lag & log spam * Changes & null fix * [Core API] Fix null & invalid cast (#2650) --------- Co-authored-by: Nameless <85962933+Misfiy@users.noreply.github.com> * Revert "Merge remote-tracking branch 'origin/dev' into apis-rework" This reverts commit 08e279f, reversing changes made to 1b8d3a5. * Exiled9 (#2641) * Changes * that --------- Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com> * Moved modified code. (#2656) --------- Co-authored-by: Nameless <85962933+Misfiy@users.noreply.github.com> Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com> Co-authored-by: Alex Rouse <123724383+ALEXWARELLC@users.noreply.github.com>
- Loading branch information
1 parent
4845e73
commit 6798314
Showing
4 changed files
with
122 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="ItemExtensions.cs" company="Exiled Team"> | ||
// Copyright (c) Exiled Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.CustomModules.API.Extensions | ||
{ | ||
using Exiled.API.Features.Items; | ||
using Exiled.CustomModules.API.Features.CustomItems; | ||
|
||
/// <summary> | ||
/// A set of extensions for <see cref="Item"/>. | ||
/// </summary> | ||
public static class ItemExtensions | ||
{ | ||
/// <inheritdoc cref="CustomItem.Get(Item)"/> | ||
public static CustomItem Get(this Item item) => CustomItem.Get(item); | ||
|
||
/// <inheritdoc cref="CustomItem.TryGet(Item, out CustomItem)"/> | ||
public static bool TryGet(this Item item, out CustomItem customItem) => CustomItem.TryGet(item, out customItem); | ||
} | ||
} |
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,24 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="PickupExtensions.cs" company="Exiled Team"> | ||
// Copyright (c) Exiled Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.CustomModules.API.Extensions | ||
{ | ||
using Exiled.API.Features.Pickups; | ||
using Exiled.CustomModules.API.Features.CustomItems; | ||
|
||
/// <summary> | ||
/// A set of extensions for <see cref="Pickup"/>. | ||
/// </summary> | ||
public static class PickupExtensions | ||
{ | ||
/// <inheritdoc cref="CustomItem.Get(Pickup)"/> | ||
public static CustomItem Get(this Pickup pickup) => CustomItem.Get(pickup); | ||
|
||
/// <inheritdoc cref="CustomItem.TryGet(Pickup, out CustomItem)"/> | ||
public static bool TryGet(this Pickup pickup, out CustomItem item) => CustomItem.TryGet(pickup, out item); | ||
} | ||
} |
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,59 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="PlayerExtensions.cs" company="Exiled Team"> | ||
// Copyright (c) Exiled Team. All rights reserved. | ||
// Licensed under the CC BY-SA 3.0 license. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
|
||
namespace Exiled.CustomModules.API.Extensions | ||
{ | ||
using System; | ||
|
||
using Exiled.API.Features; | ||
using Exiled.CustomModules.API.Features; | ||
using Exiled.CustomModules.API.Features.CustomItems; | ||
using Exiled.CustomModules.API.Features.CustomRoles; | ||
|
||
/// <summary> | ||
/// A set of extensions for <see cref="Player"/>. | ||
/// </summary> | ||
public static class PlayerExtensions | ||
{ | ||
/// <inheritdoc cref="CustomRole.Get(Pawn)"/> | ||
public static CustomRole Get(this Player player) => CustomRole.Get(player.Cast<Pawn>()); | ||
|
||
/// <inheritdoc cref="CustomRole.Spawn(Pawn, CustomRole, bool)"/> | ||
public static bool Spawn(this Player player, CustomRole customRole, bool shouldKeepPosition = false) => CustomRole.Spawn(player.Cast<Pawn>(), customRole, shouldKeepPosition); | ||
|
||
/// <inheritdoc cref="CustomRole.Spawn{T}(Pawn)"/> | ||
public static bool Spawn<T>(this Player player) | ||
where T : CustomRole => CustomRole.Spawn<T>(player.Cast<Pawn>()); | ||
|
||
/// <inheritdoc cref="CustomRole.Spawn(Pawn, string, bool)"/> | ||
public static bool Spawn(this Player player, string name, bool shouldKeepPosition = false) => CustomRole.Spawn(player.Cast<Pawn>(), name, shouldKeepPosition); | ||
|
||
/// <inheritdoc cref="CustomRole.Spawn(Pawn, uint, bool)"/> | ||
public static bool Spawn(this Player player, uint id, bool shouldKeepPosition = false) => CustomRole.Spawn(player.Cast<Pawn>(), id, shouldKeepPosition); | ||
|
||
/// <inheritdoc cref="CustomRole.TrySpawn(Pawn, CustomRole)"/> | ||
public static bool TrySpawn(this Player player, CustomRole customRole) => CustomRole.TrySpawn(player.Cast<Pawn>(), customRole); | ||
|
||
/// <inheritdoc cref="CustomRole.TrySpawn(Pawn, string)"/> | ||
public static bool TrySpawn(this Player player, string name) => CustomRole.TrySpawn(player.Cast<Pawn>(), name); | ||
|
||
/// <inheritdoc cref="CustomRole.TrySpawn(Pawn, uint)"/> | ||
public static bool TrySpawn(this Player player, uint id) => CustomRole.TrySpawn(player.Cast<Pawn>(), id); | ||
|
||
/// <inheritdoc cref="CustomRole.TryGet(Pawn, out CustomRole)"/> | ||
public static bool TryGet(this Player player, out CustomRole customRole) => CustomRole.TryGet(player.Cast<Pawn>(), out customRole); | ||
|
||
/// <inheritdoc cref="CustomItem.TryGive(Player, string, bool)"/> | ||
public static bool TryGive(this Player player, string name, bool displayMessage = true) => CustomItem.TryGive(player, name, displayMessage); | ||
|
||
/// <inheritdoc cref="CustomItem.TryGive(Player, uint, bool)"/> | ||
public static bool TryGive(this Player player, uint id, bool displayMessage = true) => CustomItem.TryGive(player, id, displayMessage); | ||
|
||
/// <inheritdoc cref="CustomItem.TryGive(Player, Type, bool)"/> | ||
public static bool TryGive(this Player player, Type type, bool displayMessage) => CustomItem.TryGive(player, type, displayMessage); | ||
} | ||
} |
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