public void FurreVsFurreIsNull()
        {
            Furre Furre1 = null;
            Furre Furre2 = null;

            Assert.Multiple(() =>
            {
                Assert.That(Furre1, Is.EqualTo(Furre2), $"F1 {Furre1} == F2 {Furre2}");
                Furre1 = new Furre();
                Furre2 = new Furre();
                Assert.That(Furre1, Is.EqualTo(Furre2), $"F1 {Furre1} == F2 {Furre2}");
                Furre1 = null;
                Furre2 = new Furre();
                Assert.That(Furre1, !Is.EqualTo(Furre2), $"F1 {Furre1} != F2 {Furre2}");
                Furre1 = new Furre();
                Furre2 = null;
                Assert.That(Furre1, !Is.EqualTo(Furre2), $"F1 {Furre1} != F2 {Furre2}");

                Furre1 = new Furre(5, "joe");
                Furre2 = new Furre(5, "joe");
                Assert.That(Furre1, Is.EqualTo(Furre2), $"F1 {Furre1} == F2 {Furre2}");
                Furre1 = new Furre(5, "joe");
                Furre2 = new Furre(5);
                Assert.That(Furre1, Is.EqualTo(Furre2), $"F1 {Furre1} == F2 {Furre2}");
                Furre1 = new Furre(5, "joe");
                Furre2 = new Furre(6);
                Assert.That(Furre1, !Is.EqualTo(Furre2), $"F1 {Furre1} != F2 {Furre2}");
            });
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChannelObject"/> class.
 /// </summary>
 /// <param name="ServerInstruction">The server instruction.</param>
 /// <param name="Furr">The furr.</param>
 public ChannelObject(string ServerInstruction, Furre Furr) : base(ServerInstruction)
 {
     instructionType     = ServerInstructionType.DisplayText;
     FontColorRegexMatch = new Regex(FontChannelFilter, RegexOptions.Compiled | RegexOptions.CultureInvariant).Match(RawInstruction);
     channelText         = ServerInstruction.ToStrippedFurcadiaMarkupString();
     player = Furr;
 }
        /// <summary>
        /// </summary>
        /// <param name="ServerInstruction">
        /// </param>
        public SpawnAvatar(string ServerInstruction) : base(ServerInstruction)
        {
            //Update What type we are
            if (ServerInstruction[0] == '<')
            {
                instructionType = ServerInstructionType.SpawnAvatar;
            }

            int ColTypePos = (ServerInstruction[ConvertFromBase220(ServerInstruction[11])] == 'w') ? 16 : 14;

            PlayerFlags = new CharacterFlags(ServerInstruction[ColTypePos]);

            Player = new Furre(ConvertFromBase220(ServerInstruction.Substring(1, 4)))
            {
                Name        = ServerInstruction.Substring(12, ConvertFromBase220(ServerInstruction[11])),
                Location    = new FurrePosition(ServerInstruction.Substring(5, 4)),
                Direction   = (AvatarDirection)ConvertFromBase220(ServerInstruction.Substring(9, 1)),
                Pose        = (FurrePose)ConvertFromBase220(ServerInstruction.Substring(10, 1)),
                AfkTime     = ConvertFromBase220(ServerInstruction.Substring(ColTypePos + 1, 4)),
                FurreColors = new ColorString(ServerInstruction.Substring(ColTypePos, (ServerInstruction[ColTypePos] == 'w') ? 16 : 14))
            };

            //player.kittersize

            // reserverd for Future updates as Character Profiles come into existance
            //if (PlayerFlags.HasFlag(CHAR_FLAG_HAS_PROFILE))
            //{
            //}
        }
        public void FurreIsNull()
        {
            Furre Furre1 = null;

            Assert.Multiple(() =>
            {
                Assert.That(Furre1, Is.EqualTo(null));
                Furre1 = new Furre();
                Assert.That(Furre1, !Is.EqualTo(null));
            });
        }
Ejemplo n.º 5
0
        /// <summary>
        /// </summary>
        /// <param name="ServerInstruction">
        /// </param>
        public DiceRolls(string ServerInstruction) : base(ServerInstruction)
        {
            Dice = new DiceObject();
            //Dice Filter needs Player Name "forced"
            Regex DiceREGEX = new Regex(DiceFilter, RegexOptions.IgnoreCase);

            System.Text.RegularExpressions.Match DiceMatch = DiceREGEX.Match(ServerInstruction);

            //Matches, in order:
            //1:      shortname()
            //2:      full(name)
            //3:      dice(count)
            //4:      sides()
            //5: +/-#
            //6: +/-  (component match)
            //7:      additional(Message)
            //8:      Final(result)

            player = new Furre(DiceMatch.Groups[3].Value)
            {
                Message = DiceMatch.Groups[7].Value
            };
            double.TryParse(DiceMatch.Groups[4].Value, out double num);
            Dice.DiceSides = num;
            num            = 0;
            double.TryParse(DiceMatch.Groups[3].Value, out num);
            Dice.DiceCount = num;
            char.TryParse(DiceMatch.Groups[6].Value, out char cchar);
            Dice.DiceCompnentMatch = cchar;
            num = 0.0;
            double.TryParse(DiceMatch.Groups[5].Value, out num);
            Dice.DiceModifyer = num;
            num = 0;
            double.TryParse(DiceMatch.Groups[8].Value, out num);
            Dice.DiceSides = num;
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MoveFurre"/> class.
 /// </summary>
 /// <param name="ServerInstruction">The server instruction.</param>
 /// <param name="ActiveFurre">The active furre.</param>
 public MoveFurre(string ServerInstruction, ref Furre ActiveFurre) : this(ServerInstruction)
 {
     ActiveFurre.Location = new FurrePosition(ServerInstruction.Substring(5, 4));
     Player = ActiveFurre;
 }