Exemplo n.º 1
0
        // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
        //     Public Method
        // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

        /// <summary>
        /// 値を比較する。
        /// </summary>
        /// <param name="other">比較対象</param>
        /// <returns>一致する場合、true</returns>
        public bool Equals(ICharaMoveCommand other)
        {
            if (ReferenceEquals(this, other))
            {
                return(true);
            }
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (CommandCode != other.CommandCode)
            {
                return(false);
            }
            if (ValueLength != other.ValueLength)
            {
                return(false);
            }

            for (var i = 0; i < ValueLength; i++)
            {
                if (GetNumberValue(i) != other.GetNumberValue(i))
                {
                    return(false);
                }
            }

            return(true);
        }
        public static void CreateRawTest(CharaMoveCommandCode code)
        {
            bool result;
            ICharaMoveCommand instance = null;

            try
            {
                instance = Factory.CreateRaw(code);
                result   = true;
            }
            catch (Exception ex)
            {
                logger.Exception(ex);
                result = false;
            }

            Assert.IsTrue(result);
            Assert.AreEqual(instance.CommandCode, code);
        }