Exemplo n.º 1
0
        public virtual OrganismMehodResult MoveAction(int index)
        {
            log.Info("Move action");

            if (index < 1 || index > 8)
            {
                return(OrganismMehodResult.Fail);
            }

            Point dot = GetCoordinates(index, Position);

            if (dot == Point.Empty)
            {
                return(OrganismMehodResult.Fail);
            }

            var obj = Enviroment.OnCell(dot);

            if (obj == null)
            {
                Enviroment.Move(this, Position, dot);
                Position = dot;

                return(OrganismMehodResult.Success);
            }

            return(OrganismMehodResult.Fail);
        }