using System;
using System.Text;

namespace ActionGame.GameResources.Models
{
    public class NonPlayerCharacterDefinition
    {
        public enum Activation { Command = 0 , Touch = 1, None = 2 }
        public Int32 TileX { get; set; }
        public Int32 TileY { get; set; }
        public Int32 CharacterSetKey { get; set; }
        public Int32 ActivationKey { get; set; }
        public Int32 MovementKey { get; set; }
        public String PlotScriptText { get; set; }
        public String HideIfVariableTrue { get; set; }
        public String ShowIfVariableTrue { get; set; }


        public String ToCsvString()
        {
            StringBuilder line = new StringBuilder();

            line.Append("NPC");
            line.Append("|");
            line.Append(TileX);
            line.Append('|');
            line.Append(TileY);
            line.Append('|');
            line.Append(CharacterSetKey);
            line.Append('|');
            line.Append(ActivationKey);
            line.Append('|');
            line.Append(MovementKey);
            line.Append('|');
            line.Append(HideIfVariableTrue);
            line.Append('|');
            line.Append(ShowIfVariableTrue);
            line.Append('|');
            line.Append(PlotScriptText.Replace("\r\n",""));

            return line.ToString();
        }

    }
}
