public override void giveOrders(ALegionary orderTaker)
        {
            Console.WriteLine("Your Rank is: {0} of File: {1}\n", rank, file);
            if (checkIfRankIsHigher(orderTaker.rank) || checkIfRankIsEqual(orderTaker.rank))
            {
                if (checkIfFileIsHigher(orderTaker.file))
                {
                    Console.WriteLine("Order were taken by Rank: {0} of File: {1}\n", orderTaker.rank, orderTaker.file);
                    return;
                }
            }


            Console.WriteLine(
                "Your order fell on silent ears.\nYou wander to people with lower ranks or files than the previous ones.\n\n");

            if (checkIfRankIsEqual(orderTaker.rank))
            {
                int orderTakerFileNumber =
                    (int)(CenturionFileRank)Enum.Parse(typeof(CenturionFileRank), orderTaker.file);
                int orderGiverFileNumber =
                    (int)(CenturionFileRank)Enum.Parse(typeof(CenturionFileRank), this.file);

                if (orderGiverFileNumber <= orderTakerFileNumber)
                {
                    //TODO: ADD LOWER OF CEN RANK TO LOWER RANKS
                    if (orderTakerFileNumber == 1)
                    {
                        int orderTakerRankNumber =
                            (int)(LegionaryRankOrder)Enum.Parse(typeof(CenturionFileRank), orderTaker.rank);
                        orderTaker.rank = ((LegionaryRankOrder)(orderTakerFileNumber - 1)).ToString();
                    }

                    orderTaker.file = ((CenturionFileRank)(orderTakerFileNumber - 1)).ToString();
                    giveOrders(orderTaker);
                }
            }
            else
            {
                //TODO:Add ranking down from Senior Officers to Centurion
                //int orderTakerRankNumber =
            }
        }
Example #2
0
 public abstract void giveOrders(ALegionary orderTaker);