summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Entities/SPlayer.cs
blob: 66c7ba44d47588fed652fe363911c550b41b4ddf (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
using System;
using System.Collections.Generic;
using StardewModdingAPI.Framework;
using StardewValley;

namespace StardewModdingAPI.Entities
{
    /// <summary>Static class for integrating with the player.</summary>
    [Obsolete("This API was never officially documented and will be removed soon.")]
    public class SPlayer
    {
        /*********
        ** Accessors
        *********/
        /// <summary>Obsolete.</summary>
        [Obsolete("Use " + nameof(Game1) + "." + nameof(Game1.getAllFarmers) + " instead")]
        public static List<Farmer> AllFarmers
        {
            get
            {
                Program.DeprecationManager.Warn(nameof(SPlayer), "1.0", DeprecationLevel.Info);
                return Game1.getAllFarmers();
            }
        }

        /// <summary>Obsolete.</summary>
        [Obsolete("Use " + nameof(Game1) + "." + nameof(Game1.player) + " instead")]
        public static Farmer CurrentFarmer
        {
            get
            {
                Program.DeprecationManager.Warn(nameof(SPlayer), "1.0", DeprecationLevel.Info);
                return Game1.player;
            }
        }

        /// <summary>Obsolete.</summary>
        [Obsolete("Use " + nameof(Game1) + "." + nameof(Game1.player) + " instead")]
        public static Farmer Player
        {
            get
            {
                Program.DeprecationManager.Warn(nameof(SPlayer), "1.0", DeprecationLevel.Info);
                return Game1.player;
            }
        }

        /// <summary>Obsolete.</summary>
        [Obsolete("Use " + nameof(Game1) + "." + nameof(Game1.player) + "." + nameof(Farmer.currentLocation) + " instead")]
        public static GameLocation CurrentFarmerLocation
        {
            get
            {
                Program.DeprecationManager.Warn(nameof(SPlayer), "1.0", DeprecationLevel.Info);
                return Game1.player.currentLocation;
            }
        }
    }
}