Esempio n. 1
0
 /// <summary>
 ///     Creates a new instance of this converter.
 /// </summary>
 /// <remarks>
 ///     See <see href="https://aka.ms/efcore-docs-value-converters">EF Core value converters</see> for more information and examples.
 /// </remarks>
 /// <param name="mappingHints">
 ///     Hints that can be used by the <see cref="ITypeMappingSource" /> to create data types with appropriate
 ///     facets for the converted data.
 /// </param>
 public GuidToStringConverter(ConverterMappingHints?mappingHints)
     : base(
         ToString(),
         ToGuid(),
         DefaultHints.With(mappingHints))
 {
 }
Esempio n. 2
0
 /// <summary>
 ///     Creates a new instance of this converter.
 /// </summary>
 /// <remarks>
 ///     See <see href="https://aka.ms/efcore-docs-value-converters">EF Core value converters</see> for more information and examples.
 /// </remarks>
 /// <param name="mappingHints">
 ///     Hints that can be used by the <see cref="ITypeMappingSource" /> to create data types with appropriate
 ///     facets for the converted data.
 /// </param>
 public StringToDateTimeConverter(ConverterMappingHints?mappingHints)
     : base(
         ToDateTime(),
         ToString(),
         DefaultHints.With(mappingHints))
 {
 }
 /// <summary>
 ///     Creates a new instance of this converter.
 /// </summary>
 /// <remarks>
 ///     See <see href="https://aka.ms/efcore-docs-value-converters">EF Core value converters</see> for more information and examples.
 /// </remarks>
 /// <param name="mappingHints">
 ///     Hints that can be used by the <see cref="ITypeMappingSource" /> to create data types with appropriate
 ///     facets for the converted data.
 /// </param>
 public DateTimeOffsetToStringConverter(ConverterMappingHints?mappingHints)
     : base(
         ToString(),
         ToDateTimeOffset(),
         DefaultHints.With(mappingHints))
 {
 }
Esempio n. 4
0
 /// <summary>
 ///     Creates a new instance of this converter.
 /// </summary>
 /// <remarks>
 ///     See <see href="https://aka.ms/efcore-docs-value-converters">EF Core value converters</see> for more information and examples.
 /// </remarks>
 /// <param name="mappingHints">
 ///     Hints that can be used by the <see cref="ITypeMappingSource" /> to create data types with appropriate
 ///     facets for the converted data.
 /// </param>
 public StringToNumberConverter(ConverterMappingHints?mappingHints)
     : base(
         ToNumber(),
         ToString(),
         DefaultHints.With(mappingHints))
 {
 }
 /// <summary>
 ///     Creates a new instance of this converter.
 /// </summary>
 /// <remarks>
 ///     See <see href="https://aka.ms/efcore-docs-value-converters">EF Core value converters</see> for more information and examples.
 /// </remarks>
 /// <param name="mappingHints">
 ///     Hints that can be used by the <see cref="ITypeMappingSource" /> to create data types with appropriate
 ///     facets for the converted data.
 /// </param>
 public StringToTimeSpanConverter(ConverterMappingHints?mappingHints)
     : base(
         ToTimeSpan(),
         ToString(),
         DefaultHints.With(mappingHints))
 {
 }
        /*
         *
         * The PickHint method is the only public method in the HintPicker class, which starts the chain of
         * determining which hint is the most appropriate for the last game performance. This method picks
         * the right hints according to played ClassType.
         *
         */

        public string PickHint()
        {
            DefaultHints defaultHints = new DefaultHints();
            List <IHint> hints;

            switch (this.ClassType)
            {
            case ClassTypeEnum.Duelist:
                hints = defaultHints.GetDuelistsHints();
                break;

            case ClassTypeEnum.Controller:
                hints = defaultHints.GetControllersHints();
                break;

            case ClassTypeEnum.Initiator:
                hints = defaultHints.GetInitiatorsHints();
                break;

            case ClassTypeEnum.Sentinel:
                hints = defaultHints.GetSentinelsHints();
                break;

            default:
                throw new ArgumentException("Invalid or a not updated character type");
            }

            return(GetHintString(hints));
        }