示例#1
0
 private void connection_OnStateChanged(object sender)
 {
     if (m_Direction.Equals(DirectionType.Input))
     {
         m_State = (sender as Connection).State;
     }
 }
        public override bool Equals(object obj)
        {
            var sensoryPattern = obj as SensoryPattern;

            if (sensoryPattern == null)
            {
                return(false);
            }

            if (Id >= 0 && Id.Equals(sensoryPattern.Id))
            {
                return(true);
            }

            if (!DirectionType.Equals(sensoryPattern.DirectionType))
            {
                return(false);
            }
            foreach (var sensoryUnit in SensoryUnits)
            {
                if (!sensoryPattern.SensoryUnits.Contains(sensoryUnit))
                {
                    return(false);
                }
            }
            return(EqualsSensoryUnits(sensoryPattern));
        }
示例#3
0
        public void MoveForward(DirectionType currentDirection)
        {
            if (currentDirection.Equals(DirectionType.N))
            {
                Y++;
            }
            else if (currentDirection.Equals(DirectionType.E))
            {
                X++;
            }
            else if (currentDirection.Equals(DirectionType.W))
            {
                X--;
            }
            else if (currentDirection.Equals(DirectionType.S))
            {
                Y--;
            }

            _validator.Validate(new Coordinate(X, Y), _plateau);
        }