2018-12-30 18:00:05 +08:00
|
|
|
using System;
|
2019-01-11 04:54:29 +08:00
|
|
|
using System.IO;
|
2018-12-30 18:00:05 +08:00
|
|
|
using Microsoft.Xna.Framework;
|
2018-12-21 05:34:08 +08:00
|
|
|
using Microsoft.Xna.Framework.Graphics;
|
2019-01-11 04:54:29 +08:00
|
|
|
using Netcode;
|
2018-12-21 05:34:08 +08:00
|
|
|
using PyTK.CustomElementHandler;
|
2018-12-22 07:28:52 +08:00
|
|
|
using Revitalize.Framework.Graphics.Animations;
|
2018-12-26 11:48:45 +08:00
|
|
|
using Revitalize.Framework.Illuminate;
|
2018-12-25 07:04:18 +08:00
|
|
|
using Revitalize.Framework.Utilities;
|
2019-01-10 18:31:23 +08:00
|
|
|
using StardewValley;
|
2018-12-21 05:34:08 +08:00
|
|
|
|
|
|
|
namespace Revitalize.Framework.Objects
|
|
|
|
{
|
2019-01-11 04:54:29 +08:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// In Order to make this network compatible, I MUST, MUST, MUST make it use this INetSerializable functionality.
|
|
|
|
/// </summary>
|
|
|
|
public class BasicItemInformation : CustomObjectData, INetSerializable
|
2018-12-21 05:34:08 +08:00
|
|
|
{
|
|
|
|
public string name;
|
|
|
|
public string description;
|
|
|
|
public string categoryName;
|
|
|
|
public Color categoryColor;
|
|
|
|
public int price;
|
|
|
|
public Vector2 TileLocation;
|
|
|
|
public int edibility;
|
|
|
|
public int fragility;
|
|
|
|
public bool canBeSetIndoors;
|
|
|
|
public bool canBeSetOutdoors;
|
|
|
|
public bool isLamp;
|
|
|
|
|
2019-01-10 18:31:23 +08:00
|
|
|
|
2018-12-22 07:28:52 +08:00
|
|
|
public AnimationManager animationManager;
|
|
|
|
public Vector2 drawPosition;
|
|
|
|
|
2018-12-23 14:55:03 +08:00
|
|
|
public Color drawColor;
|
|
|
|
|
2018-12-25 02:58:20 +08:00
|
|
|
public bool ignoreBoundingBox;
|
|
|
|
|
2018-12-25 07:04:18 +08:00
|
|
|
public InventoryManager inventory;
|
|
|
|
|
2018-12-26 11:48:45 +08:00
|
|
|
public LightManager lightManager;
|
|
|
|
|
2019-01-06 14:25:22 +08:00
|
|
|
public Enums.Direction facingDirection;
|
|
|
|
|
2018-12-30 18:00:05 +08:00
|
|
|
public BasicItemInformation()
|
2018-12-21 05:34:08 +08:00
|
|
|
{
|
2018-12-30 18:00:05 +08:00
|
|
|
this.name = "";
|
|
|
|
this.description = "";
|
|
|
|
this.categoryName = "";
|
|
|
|
this.categoryColor = new Color(0, 0, 0);
|
|
|
|
this.price = 0;
|
|
|
|
this.TileLocation = Vector2.Zero;
|
2018-12-21 05:34:08 +08:00
|
|
|
this.edibility = -300;
|
|
|
|
this.canBeSetIndoors = false;
|
|
|
|
this.canBeSetOutdoors = false;
|
2018-12-22 07:28:52 +08:00
|
|
|
|
2019-01-11 01:14:16 +08:00
|
|
|
this.animationManager = new AnimationManager();
|
2018-12-22 07:28:52 +08:00
|
|
|
this.drawPosition = Vector2.Zero;
|
2018-12-23 14:55:03 +08:00
|
|
|
this.drawColor = Color.White;
|
2018-12-25 07:04:18 +08:00
|
|
|
this.inventory = new InventoryManager();
|
2018-12-26 11:48:45 +08:00
|
|
|
this.lightManager = new LightManager();
|
2019-01-06 14:25:22 +08:00
|
|
|
|
|
|
|
this.facingDirection = Enums.Direction.Down;
|
2019-01-10 18:31:23 +08:00
|
|
|
|
2018-12-21 05:34:08 +08:00
|
|
|
}
|
|
|
|
|
2019-01-10 10:05:03 +08:00
|
|
|
public BasicItemInformation(string name, string description, string categoryName, Color categoryColor,int edibility, int fragility, bool isLamp, int price, Vector2 TileLocation, bool canBeSetOutdoors, bool canBeSetIndoors, string id, string data, Texture2D texture, Color color, int tileIndex, bool bigCraftable, Type type, CraftingData craftingData, AnimationManager animationManager, Color drawColor, bool ignoreBoundingBox, InventoryManager Inventory, LightManager Lights) : base(id, data, texture, color, tileIndex, bigCraftable, type, craftingData)
|
2018-12-21 05:34:08 +08:00
|
|
|
{
|
2019-01-10 18:31:23 +08:00
|
|
|
|
2018-12-21 05:34:08 +08:00
|
|
|
this.name = name;
|
|
|
|
this.description = description;
|
|
|
|
this.categoryName = categoryName;
|
|
|
|
this.categoryColor = categoryColor;
|
|
|
|
this.price = price;
|
|
|
|
this.TileLocation = TileLocation;
|
|
|
|
this.edibility = edibility;
|
|
|
|
|
|
|
|
this.canBeSetOutdoors = canBeSetOutdoors;
|
|
|
|
this.canBeSetIndoors = canBeSetIndoors;
|
|
|
|
this.fragility = fragility;
|
|
|
|
this.isLamp = isLamp;
|
|
|
|
|
2018-12-22 07:28:52 +08:00
|
|
|
this.animationManager = animationManager;
|
|
|
|
if (this.animationManager.IsNull)
|
|
|
|
{
|
|
|
|
this.animationManager = new AnimationManager(new Graphics.Texture2DExtended(), new Animation(new Rectangle(0, 0, 16, 16)), false);
|
|
|
|
this.animationManager.getExtendedTexture().texture = this.texture;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
this.texture = this.animationManager.getTexture();
|
|
|
|
|
|
|
|
this.drawPosition = Vector2.Zero;
|
2018-12-30 18:00:05 +08:00
|
|
|
this.drawColor = drawColor;
|
2018-12-25 02:58:20 +08:00
|
|
|
this.ignoreBoundingBox = ignoreBoundingBox;
|
2018-12-30 18:00:05 +08:00
|
|
|
this.recreateDataString();
|
|
|
|
this.inventory = Inventory ?? new InventoryManager();
|
|
|
|
this.lightManager = Lights ?? new LightManager();
|
2019-01-06 14:25:22 +08:00
|
|
|
this.facingDirection = Enums.Direction.Down;
|
2018-12-21 05:34:08 +08:00
|
|
|
}
|
|
|
|
|
2019-01-11 04:54:29 +08:00
|
|
|
public uint DirtyTick { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
|
|
|
|
|
|
|
public bool Dirty => throw new NotImplementedException();
|
|
|
|
|
|
|
|
public bool NeedsTick { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
|
|
|
public bool ChildNeedsTick { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
|
|
|
public INetSerializable Parent { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
|
|
|
|
|
|
|
public INetRoot Root => throw new NotImplementedException();
|
|
|
|
|
|
|
|
public void MarkClean()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void MarkDirty()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Read(BinaryReader reader, NetVersion version)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ReadFull(BinaryReader reader, NetVersion version)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
2018-12-21 05:34:08 +08:00
|
|
|
public void recreateDataString()
|
|
|
|
{
|
2018-12-30 18:00:05 +08:00
|
|
|
this.data = $"{this.name}/{this.price}/{this.edibility}/Crafting -9/{this.description}/{this.canBeSetOutdoors}/{this.canBeSetIndoors}/{this.fragility}/{this.isLamp}/{this.name}";
|
2018-12-21 05:34:08 +08:00
|
|
|
}
|
2019-01-10 18:31:23 +08:00
|
|
|
|
2019-01-11 04:54:29 +08:00
|
|
|
public bool Tick()
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Write(BinaryWriter writer)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void WriteFull(BinaryWriter writer)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
2018-12-21 05:34:08 +08:00
|
|
|
}
|
|
|
|
}
|