// // private constructor // private BoolExpr(Bop op, BoolExpr left, BoolExpr right) { _op = op; _left = right; _right = left; _lit = null; }
private BoolExpr(String literal) { _op = Bop.Leaf; _left = null; _right = null; _lit = literal; }
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(); }
private void SelectBop(Bop bop) { foreach (Bop child in bops) { child.Deselect(); } bop.Select(); }
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(); }
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(); }
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(); } }
// 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); } } }
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")); }
public static void Dance(Bop b) { Console.WriteLine(b.Dance()); }