<commit_before>﻿using System;
using System.IO;
using Substrate.Core;
using Substrate.Nbt;

namespace Substrate
{
    /// <summary>
    /// Encompases data to specify game rules.
    /// </summary>
    public class GameRules : ICopyable<GameRules>
    {
        private string _commandBlockOutput = "true";
        private string _doFireTick = "true";
        private string _doMobLoot = "true";
        private string _doMobSpawning = "true";
        private string _doTileDrops = "true";
        private string _keepInventory = "false";
        private string _mobGriefing = "true";

        /// <summary>
        /// Gets or sets whether or not actions performed by command blocks are displayed in the chat.
        /// </summary>
        public bool CommandBlockOutput
        {
            get { return _commandBlockOutput == "true"; }
            set { _commandBlockOutput = value ? "true" : "false"; }
        }

        /// <summary>
        /// Gets or sets whether to spread or remove fire.
        /// </summary>
        public bool DoFireTick
        {
            get { return _doFireTick == "true"; }
            set { _doFireTick = value ? "true" : "false"; ; }
        }

        /// <summary>
        /// Gets or sets whether mobs should drop loot when killed.
        /// </summary>
        public bool DoMobLoot
        {
            get { return _doMobLoot == "true"; }
            set { _doMobLoot = value ? "true" : "false"; ; }
        }

        /// <summary>
        /// Gets or sets whether mobs should spawn naturally.
        /// </summary>
        public bool DoMobSpawning
        {
            get { return _doMobSpawning == "true"; }
            set { _doMobSpawning = value ? "true" : "false"; ; }
        }

        /// <summary>
        /// Gets or sets whether breaking blocks should drop the block's item drop.
        /// </summary>
        public bool DoTileDrops
        {
            get { return _doTileDrops == "true"; }
            set { _doTileDrops = value ? "true" : "false"; ; }
        }

        /// <summary>
        /// Gets or sets whether players keep their inventory after they die.
        /// </summary>
        public bool KeepInventory
        {
            get { return _keepInventory == "true"; }
            set { _keepInventory = value ? "true" : "false"; ; }
        }

        /// <summary>
        /// Gets or sets whether mobs can destroy blocks (creeper explosions, zombies breaking doors, etc.).
        /// </summary>
        public bool MobGriefing
        {
            get { return _mobGriefing == "true"; }
            set { _mobGriefing = value ? "true" : "false"; ; }
        }

        #region ICopyable<GameRules> Members

        /// <inheritdoc />
        public GameRules Copy ()
        {<commit_msg>If exposing boolean properties, it's simpler to also keep the internal representation boolean.<commit_after>﻿using System;
using System.IO;
using Substrate.Core;
using Substrate.Nbt;

namespace Substrate
{
    /// <summary>
    /// Encompases data to specify game rules.
    /// </summary>
    public class GameRules : ICopyable<GameRules>
    {
        private bool _commandBlockOutput = true;
        private bool _doFireTick = true;
        private bool _doMobLoot = true;
        private bool _doMobSpawning = true;
        private bool _doTileDrops = true;
        private bool _keepInventory = false;
        private bool _mobGriefing = true;

        /// <summary>
        /// Gets or sets whether or not actions performed by command blocks are displayed in the chat.
        /// </summary>
        public bool CommandBlockOutput
        {
            get { return _commandBlockOutput; }
            set { _commandBlockOutput = value; }
        }

        /// <summary>
        /// Gets or sets whether to spread or remove fire.
        /// </summary>
        public bool DoFireTick
        {
            get { return _doFireTick; }
            set { _doFireTick = value; }
        }

        /// <summary>
        /// Gets or sets whether mobs should drop loot when killed.
        /// </summary>
        public bool DoMobLoot
        {
            get { return _doMobLoot; }
            set { _doMobLoot = value; }
        }

        /// <summary>
        /// Gets or sets whether mobs should spawn naturally.
        /// </summary>
        public bool DoMobSpawning
        {
            get { return _doMobSpawning; }
            set { _doMobSpawning = value; }
        }

        /// <summary>
        /// Gets or sets whether breaking blocks should drop the block's item drop.
        /// </summary>
        public bool DoTileDrops
        {
            get { return _doTileDrops; }
            set { _doTileDrops = value; }
        }

        /// <summary>
        /// Gets or sets whether players keep their inventory after they die.
        /// </summary>
        public bool KeepInventory
        {
            get { return _keepInventory; }
            set { _keepInventory = value; }
        }

        /// <summary>
        /// Gets or sets whether mobs can destroy blocks (creeper explosions, zombies breaking doors, etc.).
        /// </summary>
        public bool MobGriefing
        {
            get { return _mobGriefing; }
            set { _mobGriefing = value; }
        }

        #region ICopyable<GameRules> Members

        /// <inheritdoc />
        public GameRules Copy ()
        {
{'fraction_non_alphanumeric': 0.10277777777777777, 'fraction_numerical': 0.0, 'mean_word_length': 1.5743565300285987, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6171293', 'n_tokens_mistral': 1478, 'n_tokens_neox': 1433, 'n_words': 461}