public static ErrorType GetTargetEntityError(Entity source, Entity target) { if (!s_initialized) { return(ErrorType.NONE); } Player owningPlayer = GetOwningPlayer(source); if (owningPlayer == null) { return(ErrorType.NONE); } SourceEntityInfo sourceInfo = source.ConvertToSourceInfo(GetPlayRequirementInfo(source), null); PlayerInfo playerInfo = owningPlayer.ConvertToPlayerInfo(); GameStateInfo gameInfo = GameState.Get().ConvertToGameStateInfo(); Marshaled_PlayErrorsParams playErrorsParams = new Marshaled_PlayErrorsParams(sourceInfo, playerInfo, gameInfo); Marshaled_TargetEntityInfo info4 = Marshaled_TargetEntityInfo.ConvertFromTargetEntityInfo(target.ConvertToTargetInfo()); List <Marshaled_TargetEntityInfo> marshaledEntitiesInPlay = GetMarshaledEntitiesInPlay(); return(DLL_GetTargetEntityError(playErrorsParams, info4, marshaledEntitiesInPlay.ToArray(), marshaledEntitiesInPlay.Count)); }
public static ErrorType GetPlayEntityError(Entity source) { Log.PlayErrors.Print(string.Concat(new object[] { "GetPlayEntityError (", s_initialized, ") ", source }), new object[0]); if (!s_initialized) { return(ErrorType.NONE); } Player owningPlayer = GetOwningPlayer(source); if (owningPlayer == null) { return(ErrorType.NONE); } SourceEntityInfo sourceInfo = source.ConvertToSourceInfo(GetPlayRequirementInfo(source), null); PlayerInfo playerInfo = owningPlayer.ConvertToPlayerInfo(); GameStateInfo gameInfo = GameState.Get().ConvertToGameStateInfo(); Marshaled_PlayErrorsParams playErrorsParams = new Marshaled_PlayErrorsParams(sourceInfo, playerInfo, gameInfo); List <Marshaled_TargetEntityInfo> marshaledEntitiesInPlay = GetMarshaledEntitiesInPlay(); List <Marshaled_SourceEntityInfo> marshaledSubCards = GetMarshaledSubCards(source); return(DLL_GetPlayEntityError(playErrorsParams, marshaledSubCards.ToArray(), marshaledSubCards.Count, marshaledEntitiesInPlay.ToArray(), marshaledEntitiesInPlay.Count)); }