summaryrefslogtreecommitdiff
path: root/src/SMAPI.Tests.ModApiConsumer/Interfaces/ISimpleApi.cs
blob: c99605e4fc8e606fdcd78d7175cd14fc4ce69b71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System;
using System.Collections.Generic;
using System.Reflection;
using StardewModdingAPI.Utilities;

namespace SMAPI.Tests.ModApiConsumer.Interfaces
{
    /// <summary>A mod-provided API which provides basic events, properties, and methods.</summary>
    public interface ISimpleApi
    {
        /*********
        ** Test interface
        *********/
        /****
        ** Events
        ****/
        /// <summary>A simple event field.</summary>
        event EventHandler<int> OnEventRaised;

        /// <summary>A simple event property with custom add/remove logic.</summary>
        event EventHandler<int> OnEventRaisedProperty;


        /****
        ** Properties
        ****/
        /// <summary>A simple numeric property.</summary>
        int NumberProperty { get; set; }

        /// <summary>A simple object property.</summary>
        object ObjectProperty { get; set; }

        /// <summary>A simple list property.</summary>
        List<string> ListProperty { get; set; }

        /// <summary>A simple list property with an interface.</summary>
        IList<string> ListPropertyWithInterface { get; set; }

        /// <summary>A property with nested generics.</summary>
        IDictionary<string, IList<string>> GenericsProperty { get; set; }

        /// <summary>A property using an enum available to both mods.</summary>
        BindingFlags EnumProperty { get; set; }

        /// <summary>A read-only property.</summary>
        int GetterProperty { get; }


        /****
        ** Methods
        ****/
        /// <summary>A simple method with no return value.</summary>
        void GetNothing();

        /// <summary>A simple method which returns a number.</summary>
        int GetInt(int value);

        /// <summary>A simple method which returns an object.</summary>
        object GetObject(object value);

        /// <summary>A simple method which returns a list.</summary>
        List<string> GetList(string value);

        /// <summary>A simple method which returns a list with an interface.</summary>
        IList<string> GetListWithInterface(string value);

        /// <summary>A simple method which returns nested generics.</summary>
        IDictionary<string, IList<string>> GetGenerics(string key, string value);

        /// <summary>A simple method which returns a lambda.</summary>
        Func<string, string> GetLambda(Func<string, string> value);

        /// <summary>A simple method which returns out parameters.</summary>
        bool TryGetOutParameter(int inputNumber, out int outNumber, out string outString, out PerScreen<int> outReference, out IDictionary<int, PerScreen<int>> outComplexType);


        /****
        ** Inherited members
        ****/
        /// <summary>A property inherited from a base class.</summary>
        public string InheritedProperty { get; set; }
    }
}