~ruther/NosSmooth

1b78257b6b32ace8a2a8afdf36be8a2f33f10ba7 — Rutherther 3 years ago 171d6d3
feat(combat): add errors
A Extensions/NosSmooth.Extensions.Combat/Errors/CharacterNotInitializedError.cs => Extensions/NosSmooth.Extensions.Combat/Errors/CharacterNotInitializedError.cs +15 -0
@@ 0,0 1,15 @@
//
//  CharacterNotInitializedError.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Remora.Results;

namespace NosSmooth.Extensions.Combat.Errors;

/// <summary>
/// The character is not initialized.
/// </summary>
public record CharacterNotInitializedError(string Field = "")
    : ResultError($"The character {Field} is not yet initialized.");
\ No newline at end of file

A Extensions/NosSmooth.Extensions.Combat/Errors/EntityNotFoundError.cs => Extensions/NosSmooth.Extensions.Combat/Errors/EntityNotFoundError.cs +14 -0
@@ 0,0 1,14 @@
//
//  EntityNotFoundError.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Remora.Results;

namespace NosSmooth.Extensions.Combat.Errors;

/// <summary>
/// Matching entity not found error.
/// </summary>
public record EntityNotFoundError() : ResultError("Could not find an entity that matches the conditions.");
\ No newline at end of file

A Extensions/NosSmooth.Extensions.Combat/Errors/ItemNotFoundError.cs => Extensions/NosSmooth.Extensions.Combat/Errors/ItemNotFoundError.cs +14 -0
@@ 0,0 1,14 @@
//
//  ItemNotFoundError.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Remora.Results;

namespace NosSmooth.Extensions.Combat.Errors;

/// <summary>
/// Matchin item not found error.
/// </summary>
public record ItemNotFoundError() : ResultError("Could not find an item that matches the conditions.");
\ No newline at end of file

A Extensions/NosSmooth.Extensions.Combat/Errors/MapNotInitializedError.cs => Extensions/NosSmooth.Extensions.Combat/Errors/MapNotInitializedError.cs +15 -0
@@ 0,0 1,15 @@
//
//  MapNotInitializedError.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Remora.Results;

namespace NosSmooth.Extensions.Combat.Errors;

/// <summary>
/// The map is not initialized.
/// </summary>
public record MapNotInitializedError()
    : ResultError("The map is not yet initialized.");
\ No newline at end of file

A Extensions/NosSmooth.Extensions.Combat/Errors/MissingInfoError.cs => Extensions/NosSmooth.Extensions.Combat/Errors/MissingInfoError.cs +16 -0
@@ 0,0 1,16 @@
//
//  MissingInfoError.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Remora.Results;

namespace NosSmooth.Extensions.Combat.Errors;

/// <summary>
/// Missing info of a specified type and id..
/// </summary>
/// <param name="Type">The type.</param>
/// <param name="Id">The id.</param>
public record MissingInfoError(string Type, long Id) : ResultError($"Cannot find info of {{Type}} with id {Id}.");
\ No newline at end of file

A Extensions/NosSmooth.Extensions.Combat/Errors/SkillNotFoundError.cs => Extensions/NosSmooth.Extensions.Combat/Errors/SkillNotFoundError.cs +14 -0
@@ 0,0 1,14 @@
//
//  SkillNotFoundError.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Remora.Results;

namespace NosSmooth.Extensions.Combat.Errors;

/// <summary>
/// Matchin skill not found.
/// </summary>
public record SkillNotFoundError() : ResultError("Could not find a skill that matches the conditions.");
\ No newline at end of file

A Extensions/NosSmooth.Extensions.Combat/Errors/TargetNotSetError.cs => Extensions/NosSmooth.Extensions.Combat/Errors/TargetNotSetError.cs +11 -0
@@ 0,0 1,11 @@
//
//  TargetNotSetError.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Remora.Results;

namespace NosSmooth.Extensions.Combat.Errors;

public record TargetNotSetError() : ResultError("The current target is not set, the operation cannot complete.");
\ No newline at end of file

A Extensions/NosSmooth.Extensions.Combat/Errors/UnusableOperationError.cs => Extensions/NosSmooth.Extensions.Combat/Errors/UnusableOperationError.cs +17 -0
@@ 0,0 1,17 @@
//
//  UnusableOperationError.cs
//
//  Copyright (c) František Boháček. All rights reserved.
//  Licensed under the MIT license. See LICENSE file in the project root for full license information.

using NosSmooth.Extensions.Combat.Operations;
using Remora.Results;

namespace NosSmooth.Extensions.Combat.Errors;

/// <summary>
/// An error that tells the operation was unusable.
/// </summary>
/// <param name="Operation">The operation.</param>
public record UnusableOperationError(ICombatOperation Operation)
    : ResultError("A given operation {Operation} responded that it won't be usable ever and thus there is an unrecoverable state.");
\ No newline at end of file