Ejemplo n.º 1
0
        //
        //  private constructor
        //

        private BoolExpr(Bop op, BoolExpr left, BoolExpr right)
        {
            _op    = op;
            _left  = right;
            _right = left;
            _lit   = null;
        }
Ejemplo n.º 2
0
 private BoolExpr(String literal)
 {
     _op    = Bop.Leaf;
     _left  = null;
     _right = null;
     _lit   = literal;
 }
Ejemplo n.º 3
0
 public BoolExpr(BoolExpr other)
 {
     // No share any object on purpose
     _op    = other._op;
     _left  = other._left == null ? null : new BoolExpr(other._left);
     _right = other._right == null ? null : new BoolExpr(other._right);
     _lit   = new StringBuilder(other._lit).ToString();
 }
Ejemplo n.º 4
0
 private void SelectBop(Bop bop)
 {
     foreach (Bop child in bops)
     {
         child.Deselect();
     }
     bop.Select();
 }
Ejemplo n.º 5
0
    private void RaiseRandomBop(Bop exceptForThisOne = null)
    {
        Bop randomBop = bops[UnityEngine.Random.Range(0, bops.Length)];

        while (randomBop == exceptForThisOne)
        {
            randomBop = bops[UnityEngine.Random.Range(0, bops.Length)];
        }

        randomBop.Raise();
    }
Ejemplo n.º 6
0
        public static void Main(String[] args)
        {
            Object o1 = new Thing();
            Bop    b  = (Bop)o1;

            b.Dance();
            Musician m = (Musician)o1;

            m.Sing();
            Musician m2 = (Musician)b;

            b.Dance();
        }
Ejemplo n.º 7
0
    private void DoABopIt(Bop bop)
    {
        if (bop.GetCurrentState() == ButtonState.Up)
        {
            // Depress the tapped bop
            bop.Depress();

            // Raise a different random one
            RaiseRandomBop(exceptForThisOne: bop);

            OnBop?.Invoke();
        }
    }
Ejemplo n.º 8
0
    // Update is called once per frame
    void Update()
    {
        Ray ray = GetInputRay();

        if (Physics.Raycast(ray, out var hit, 1000f))
        {
            Transform transform = hit.transform;
            Bop       bop       = transform.parent.GetComponent <Bop>();
            SelectBop(bop);

            // If receiving input - BOP IT!
            if (IsInputHappening())
            {
                DoABopIt(bop);
            }
        }
    }
Ejemplo n.º 9
0
        public async Task <IActionResult> Create([FromForm] BopsDetailModel bopsDetail)
        {
            if (!ModelState.IsValid)
            {
                bopsDetail.Genres = await genre.GetAllAsync();

                return(View("Create", bopsDetail));
            }

            var artiste = await account.Find(x => x.Id == 1);

            var model = new Bop()
            {
                Artiste      = artiste,
                ReleaseDate  = DateTime.Parse(bopsDetail.ReleaseDate),
                Genre        = await genre.Find(x => x.Id == bopsDetail.Genre),
                ReleaseVenue = "Lagos",
                BopName      = bopsDetail.BopName,
            };

            bop.Add(model);
            bop.Save();
            return(RedirectToAction("Index", "Home"));
        }
Ejemplo n.º 10
0
 public static void Dance(Bop b)
 {
     Console.WriteLine(b.Dance());
 }