using Newtonsoft.Json;
using System;
using System.Collections.Generic;


namespace ActionGame.GameArtifacts.Models.Game
{
    public class VariableState
    {
        [JsonProperty]
        private Dictionary<String, Boolean> variables;
        
        public VariableState()
        {
            this.variables = new Dictionary<String, Boolean>();
        }


        public void SetVariable(String variable, Boolean state)
        {
            if(this.variables.ContainsKey(variable))
            {
                this.variables[variable] = state;
            }
            else
            {
                this.variables.Add(variable, state);
            }
        }


        public Boolean GetVariable(String variable)
        {
            Boolean result = false;

            if(this.variables.ContainsKey(variable))
            {
                result = this.variables[variable];
            }

            return result;
        }


    }
}
