예제 #1
0
        public new bool takeCupcake(Actor cupcake)
        {
            if (cupcake != null)
            {
                for (int i = 0; i < StoredCupcakes.Count(); i++)
                {
                    if (StoredCupcakes[i] == null)
                    {
                        float tempX = this.Position.X;
                        float tempY = this.Position.Y + 64;
                        tempX = tempX + (i % 3) * 64;
                        tempY = tempY + (float)Math.Floor((double)(i / 3)) * 64;

                        cupcake.Position = new Vector2(tempX, tempY);
                        //Console.WriteLine("cupcake " + i + " at " + cupcake.Position.ToString());
                        StoredCupcakes[i] = cupcake;
                        return true;
                    }
                }
            }
            //if you return false, show some kind of PAN FULL warning to player
            return false;
        }
예제 #2
0
 public void takeCupcake(Actor cupcake)
 {
     if (cupcake != null)
     {
         if (storedCupcakes[getLowerFacingContainerFromRotation()] == null)
             storedCupcakes[getLowerFacingContainerFromRotation()] = cupcake;
     }
 }