45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
using int2 = Unity.Mathematics.int2;
|
|
|
|
public abstract class DragObject
|
|
{
|
|
}
|
|
|
|
public abstract class ItemDragObject : DragObject
|
|
{
|
|
protected ItemDragObject(int2 originCellOffset, ItemInstance item)
|
|
{
|
|
OriginCellOffset = originCellOffset;
|
|
Item = item;
|
|
}
|
|
|
|
public ItemInstance Item { get; }
|
|
public int2 OriginCellOffset { get; }
|
|
}
|
|
|
|
public class ItemInstanceDragObject : ItemDragObject
|
|
{
|
|
public ItemInstanceDragObject(ItemInstance item, EquippedCargoBay originInventory, int2 originCellOffset)
|
|
: base(originCellOffset, item)
|
|
{
|
|
OriginInventory = originInventory;
|
|
}
|
|
|
|
public EquippedCargoBay OriginInventory { get; }
|
|
}
|
|
|
|
public class EquippedItemDragObject : ItemDragObject
|
|
{
|
|
public EquippedItemDragObject(EquippedItem item, Entity originEntity, int2 originCellOffset)
|
|
: base(originCellOffset, item.EquippableItem)
|
|
{
|
|
EquippedItem = item;
|
|
OriginEntity = originEntity;
|
|
}
|
|
|
|
public EquippedItem EquippedItem { get; }
|
|
public Entity OriginEntity { get; }
|
|
}
|