init
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace VOID.Generic.Objects.Unit.Actions.Exceptions
|
||||
{
|
||||
public class UnitActionErrorException : Exception
|
||||
{
|
||||
public readonly AbstractAction action;
|
||||
public readonly UnitActionErrorType unitActionErrorType;
|
||||
|
||||
public UnitActionErrorException(AbstractAction action, UnitActionErrorType unitActionErrorType)
|
||||
{
|
||||
this.action = action;
|
||||
this.unitActionErrorType = unitActionErrorType;
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 875cbf9757a34df9a5e9679dfa3247e6
|
||||
timeCreated: 1686666485
|
||||
@@ -0,0 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace VOID.Generic.Objects.Unit.Actions.Exceptions
|
||||
{
|
||||
public static class UnitActionErrorMessage
|
||||
{
|
||||
private static readonly Dictionary<UnitActionErrorType, string> Messages = new()
|
||||
{
|
||||
[UnitActionErrorType.ActionStateIsNotReady] = "Can't do this action yet",
|
||||
[UnitActionErrorType.NotInRange] = "Target is out of range",
|
||||
[UnitActionErrorType.UnitStateIsNotControllable] = "Unit is busy",
|
||||
[UnitActionErrorType.UnitDontCarryThatItem] = "Unit don't carry that item",
|
||||
[UnitActionErrorType.UnitDontWearThatItem] = "Unit don't wear that item",
|
||||
[UnitActionErrorType.ItemIsNotOnGround] = "Item is not on ground",
|
||||
[UnitActionErrorType.RequirementsNotMeetToEquipThatItem] = "Unit don't meet requirement to equip that item",
|
||||
[UnitActionErrorType.CannotEquipItemInThatSlot] = "That item can't be equipped in this equipment slot",
|
||||
[UnitActionErrorType.RequirementsNotMeetToUseThatItem] = "Unit don't meet requirement to use that item",
|
||||
[UnitActionErrorType.RequirementsNotMeetToUseThatAbility] = "Unit don't meet requirement to use that ability",
|
||||
[UnitActionErrorType.UnEquipIsPrevented] = "UnEquip prevented",
|
||||
[UnitActionErrorType.DropIsPrevented] = "Drop prevented",
|
||||
[UnitActionErrorType.EquipIsPrevented] = "Equip prevented",
|
||||
[UnitActionErrorType.PickIsPrevented] = "Pick prevented",
|
||||
[UnitActionErrorType.UseIsPrevented] = "Use prevented",
|
||||
[UnitActionErrorType.ContainerIsNotOpenedByThisUnit] = "Container is not opened by this unit",
|
||||
[UnitActionErrorType.ItemIsNotMovable] = "That item can't be moved",
|
||||
[UnitActionErrorType.ItemIsNotPickable] = "That item can't be picked",
|
||||
[UnitActionErrorType.AbilityIsPrevented] = "Ability prevented",
|
||||
[UnitActionErrorType.AbilityHitIsPrevented] = "Ability hit prevented",
|
||||
[UnitActionErrorType.UsableNotEnoughStacks] = "Item don't have enough stacks to be used",
|
||||
[UnitActionErrorType.PreviousActionNotFinished] = "Previous required action wasn't finished",
|
||||
[UnitActionErrorType.UnitNotInTurnManager] = "Unit don't participate in any turn mechanics",
|
||||
[UnitActionErrorType.UnitSelfTurnNotActive] = "It's not this unit's turn",
|
||||
[UnitActionErrorType.UnitNotEnoughActionPoints] = "Not enough action points to do that",
|
||||
[UnitActionErrorType.UnitNotEnoughMovePoints] = "Not enough move points to do that",
|
||||
[UnitActionErrorType.TalkNotAvailableWhenTurnActive] = "Talking during turn mechanics not available",
|
||||
[UnitActionErrorType.ThisUnitCantMove] = "This unit can't do Move action",
|
||||
[UnitActionErrorType.ThisUnitCantAttack] = "This unit can't do Attack action",
|
||||
[UnitActionErrorType.ThisUnitCantUse] = "This unit can't do Use action",
|
||||
[UnitActionErrorType.ThisUnitCantTalk] = "This unit can't do Talk action",
|
||||
[UnitActionErrorType.ThisUnitCantTake] = "This unit can't do Take action",
|
||||
[UnitActionErrorType.ThisUnitCantInspect] = "This unit can't do Inspect action",
|
||||
[UnitActionErrorType.OtherUnitCantBeInspected] = "Other unit can't be Inspected",
|
||||
[UnitActionErrorType.OtherUnitCantBeTalked] = "Other unit can't be Talked with",
|
||||
};
|
||||
|
||||
public static string Get(UnitActionErrorType errorType)
|
||||
{
|
||||
return Messages.GetValueOrDefault(errorType, errorType.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 751eee10c5954993b708a8ec5bea1b6b
|
||||
timeCreated: 1698959051
|
||||
@@ -0,0 +1,49 @@
|
||||
namespace VOID.Generic.Objects.Unit.Actions.Exceptions
|
||||
{
|
||||
public enum UnitActionErrorType
|
||||
{
|
||||
ActionStateIsNotReady,
|
||||
NotInRange,
|
||||
UnitStateIsNotControllable,
|
||||
UnitDontCarryThatItem,
|
||||
UnitDontWearThatItem,
|
||||
ItemIsNotOnGround,
|
||||
RequirementsNotMeetToEquipThatItem,
|
||||
CannotEquipItemInThatSlot,
|
||||
RequirementsNotMeetToUseThatItem,
|
||||
RequirementsNotMeetToUseThatAbility,
|
||||
WrongNumberOfTargetsToUseThatAbility,
|
||||
WrongTargetsSelectedToUseThatAbility,
|
||||
UnEquipIsPrevented,
|
||||
DropIsPrevented,
|
||||
EquipIsPrevented,
|
||||
PickIsPrevented,
|
||||
UseIsPrevented,
|
||||
ContainerIsNotOpenedByThisUnit,
|
||||
ItemIsNotMovable,
|
||||
ItemIsNotPickable,
|
||||
AbilityIsPrevented,
|
||||
AbilityHitIsPrevented,
|
||||
UsableNotEnoughStacks,
|
||||
PreviousActionNotFinished,
|
||||
UnitNotInTurnManager,
|
||||
UnitSelfTurnNotActive,
|
||||
UnitNotEnoughActionPoints,
|
||||
UnitNotEnoughMovePoints,
|
||||
TalkNotAvailableWhenTurnActive,
|
||||
ContainerIsAlreadyOpenedByThisUnit,
|
||||
EnemiesAreTooClose,
|
||||
OtherUnitIsNotOpenedByThisUnit,
|
||||
OtherUnitIsAlreadyOpenedByThisUnit,
|
||||
NoPathToTarget,
|
||||
ThisUnitCantMove,
|
||||
ThisUnitCantAttack,
|
||||
ThisUnitCantUse,
|
||||
ThisUnitCantTalk,
|
||||
ThisUnitCantTake,
|
||||
ThisUnitCantInspect,
|
||||
OtherUnitCantBeInspected,
|
||||
OtherUnitCantBeTalked,
|
||||
ThisUnitIsCasting
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 29d18411212c41ccbbebd94f8ff33538
|
||||
timeCreated: 1686666706
|
||||
Reference in New Issue
Block a user