diff options
author | Zoryn <Zoryn4163@users.noreply.github.com> | 2016-03-23 13:43:41 -0400 |
---|---|---|
committer | Zoryn <Zoryn4163@users.noreply.github.com> | 2016-03-23 13:43:41 -0400 |
commit | d3912b43052a79068d72b5689b8c6d901fbb72ea (patch) | |
tree | 1a67172990e15c8ba57ea6add2dd6d1810222ac2 /StardewModdingAPI/Inheritance | |
parent | 4c4d3e66fe2e18c424c08a295d628432fca767cd (diff) | |
parent | 49e035dd2289d58cc2cb6585027f3f038344404f (diff) | |
download | SMAPI-d3912b43052a79068d72b5689b8c6d901fbb72ea.tar.gz SMAPI-d3912b43052a79068d72b5689b8c6d901fbb72ea.tar.bz2 SMAPI-d3912b43052a79068d72b5689b8c6d901fbb72ea.zip |
Merge pull request #57 from Zoryn4163/master
0.39.1 inbound!
Diffstat (limited to 'StardewModdingAPI/Inheritance')
-rw-r--r-- | StardewModdingAPI/Inheritance/SGameLocation.cs | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/StardewModdingAPI/Inheritance/SGameLocation.cs b/StardewModdingAPI/Inheritance/SGameLocation.cs deleted file mode 100644 index 2d9a17ec..00000000 --- a/StardewModdingAPI/Inheritance/SGameLocation.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using StardewValley; - -namespace StardewModdingAPI.Inheritance -{ - [Obsolete] - public class SGameLocation : GameLocation - { - public GameLocation BaseGameLocation { get; private set; } - - public SerializableDictionary<Vector2, SObject> ModObjects { get; set; } - - public static SGameLocation ConstructFromBaseClass(GameLocation baseClass, bool copyAllData = false) - { - SGameLocation s = new SGameLocation(); - s.BaseGameLocation = baseClass; - s.name = baseClass.name; - - Log.Debug("CONSTRUCTED: " + s.name); - - if (copyAllData) - { - foreach (var v in baseClass.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)) - { - try - { - var fi = s.GetType().GetField(v.Name, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance); - if (fi != null && !fi.IsStatic) - { - fi.SetValue(s, v.GetValue(baseClass)); - //Console.WriteLine("SET {0} ON {1} TO {2}", fi.Name, s.name, v.GetValue(baseClass)); - } - } - catch (Exception ex) - { - Log.Error(ex); - } - } - } - - return s; - } - - public static List<SGameLocation> ConstructFromBaseClasses(List<GameLocation> baseGameLocations, bool copyAllData = false) - { - return baseGameLocations.Select(gl => ConstructFromBaseClass(gl, copyAllData)).ToList(); - } - - public virtual void update(GameTime gameTime) - { - } - - public override void draw(SpriteBatch b) - { - foreach (var v in ModObjects) - { - v.Value.draw(b, (int)v.Key.X, (int)v.Key.Y, 0.999f, 1); - } - } - - public SGameLocation() - { - ModObjects = new SerializableDictionary<Vector2, SObject>(); - } - } -} |