More warning fixes
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using PkmnLib.Dynamic.Models;
|
||||
using PkmnLib.Dynamic.Models.Choices;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
namespace PkmnLib.Dynamic.AI;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public class RandomAI : PokemonAI
|
||||
continue;
|
||||
}
|
||||
var target = targets[_random.GetInt(targets.Length)];
|
||||
var moveTurnChoice = new MoveChoice(pokemon, move!, target.side, target.position);
|
||||
var moveTurnChoice = new MoveChoice(pokemon, move, target.side, target.position);
|
||||
if (battle.CanUse(moveTurnChoice))
|
||||
{
|
||||
return moveTurnChoice;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using JetBrains.Annotations;
|
||||
using PkmnLib.Dynamic.ScriptHandling;
|
||||
using PkmnLib.Static.Utils;
|
||||
|
||||
@@ -33,12 +34,19 @@ public interface IMoveChoice : ITurnChoice
|
||||
/// </summary>
|
||||
ScriptContainer Script { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Additional data that can be used by scripts to store information about the choice.
|
||||
/// </summary>
|
||||
Dictionary<StringKey, object?>? AdditionalData { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Volatile effects that are applied to the move choice.
|
||||
/// </summary>
|
||||
IScriptSet Volatile { get; }
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IMoveChoice"/>
|
||||
[PublicAPI]
|
||||
public class MoveChoice : TurnChoice, IMoveChoice
|
||||
{
|
||||
/// <inheritdoc cref="MoveChoice"/>
|
||||
|
||||
@@ -525,7 +525,7 @@ public class PokemonImpl : ScriptSource, IPokemon
|
||||
return null;
|
||||
if (!library.StaticLibrary.Moves.TryGet(move.MoveName, out var moveData))
|
||||
throw new KeyNotFoundException($"Move {move.MoveName} not found");
|
||||
return new LearnedMoveImpl(moveData, move.LearnMethod, move.CurrentPp);
|
||||
return (ILearnedMove)new LearnedMoveImpl(moveData, move.LearnMethod, move.CurrentPp);
|
||||
}).ToArray();
|
||||
AllowedExperience = serializedPokemon.AllowedExperience;
|
||||
IsEgg = serializedPokemon.IsEgg;
|
||||
|
||||
2
PkmnLib.Dynamic/PkmnLib.Dynamic.csproj.DotSettings
Normal file
2
PkmnLib.Dynamic/PkmnLib.Dynamic.csproj.DotSettings
Normal file
@@ -0,0 +1,2 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=events_005Chandling/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
Reference in New Issue
Block a user