コード例 #1
0
ファイル: MoveableSlot.cs プロジェクト: KateHowland/flip
 public string GetNaturalLanguage()
 {
     if (Contents == null)
     {
         return(fitter.GetMoveableDescription());
     }
     else
     {
         return(Contents.GetNaturalLanguage());
     }
 }
コード例 #2
0
        /// <summary>
        /// Constructs a new <see cref="BlockSlot"/> instance.
        /// </summary>
        /// <param name="fitter">A fitter which decides whether a
        /// given Moveable can fit into this slot.</param>
        public BlockSlot(Fitter fitter) : base(fitter)
        {
            InitializeComponent();

            this.fitter = fitter;

            border.MinWidth  = ObjectBlock.DefaultSize.Width + border.BorderThickness.Left + border.BorderThickness.Right;
            border.MinHeight = ObjectBlock.DefaultSize.Height + border.BorderThickness.Top + border.BorderThickness.Bottom;

            string text = fitter.GetMoveableDescription();

            if (text == "something")
            {
                text = "some thing";
            }

            fitterText.Text       = text;
            fitterText.Foreground = Brushes.DarkSlateBlue;
            fitterText.MaxWidth   = border.MinWidth;
            fitterText.MaxHeight  = border.MinHeight;
            fitterText.Padding    = textThickness;

            SetDefaultAppearance();
        }