示例#1
0
 private static void ConfiscateSwag(Thief thief, Police police)
 {
     for (int i = 0; i < thief.Swag.Count; i++)
     {
         police.ConfiscatedItems[i].NoOfItems += thief.Swag[i].NoOfItems;
         thief.Swag[i].NoOfItems = 0;
     }
 }
示例#2
0
        public static string PrintPolice(Police p)
        {
            string s = $"xdir: {p.XDirection}, ydir: {p.YDirection}, " +
                       $"xpos: {p.XPosition}, ypos: {p.YPosition}, ";

            for (int i = 0; i < p.ConfiscatedItems.Count; i++)
            {
                s += $"{p.ConfiscatedItems[i]}, ";
            }
            return(s);
        }