// Copyright (c) Pixel Crushers. All rights reserved.
namespace PixelCrushers.DialogueSystem
{
///
/// An item asset. In Chat Mapper, items are usually used to track the status of items in the
/// simulation. You can still do this in the Dialogue System; however the QuestLog class gives
/// you the option of using the item table to track quest log information instead. (See @ref
/// questLogSystem)
///
[System.Serializable]
public class Item : Asset
{
///
/// Gets or sets the field 'Is Item' which indicates whether this asset is an item
/// or a quest.
///
///
/// true if asset is actually an item; false if the asset is actually
/// a quest.
///
public bool IsItem
{
get { return LookupBool(DialogueSystemFields.IsItem); }
set { Field.SetValue(fields, DialogueSystemFields.IsItem, value); }
}
///
/// Gets or sets the field 'Group' which is an optional group for quest categorization.
///
/// The group, or empty string if none.
public string Group
{
get { return LookupValue(DialogueSystemFields.Group); }
set { Field.SetValue(fields, DialogueSystemFields.Group, value); }
}
///
/// Initializes a new Item.
///
public Item() { }
///
/// Copy constructor.
///
/// Source item.
public Item(Item sourceItem) : base(sourceItem as Asset) { }
///
/// Initializes a new Item copied from a Chat Mapper item.
///
///
/// The Chat Mapper item.
///
public Item(ChatMapper.Item chatMapperItem)
{
Assign(chatMapperItem);
}
///
/// Copies a Chat Mapper item.
///
///
/// The Chat Mapper item.
///
public void Assign(ChatMapper.Item chatMapperItem)
{
if (chatMapperItem != null) Assign(chatMapperItem.ID, chatMapperItem.Fields);
}
}
}