public void DropOffDiscs(BaGuaElementType type) { var element = GetElement(type); var discs = element.RemoveAllDiscs(); var dropLocation = element; for (int i = 0; i < discs.Length; i++) { dropLocation = _counterClockWiseElements[dropLocation]; var disc = discs[i]; dropLocation.AddDisc(disc); } DiscsDropped(new BaGuaDiscConfigurationChangedEvent { DiscsRemovedFrom = element.Type, DiscConfiguration = _elements.Select(e => new BaGuaDiscConfigurationChangedEvent.ElementDiscs { Discs = e.GetDiscConfiguration(), ElementType = e.Type }).ToArray() }); }
public void RequestToDropOffDiscs(BaGuaElementType type) { var action = _baGuaWheel.DetermineAction(type); if (IsAllowedAction(action)) { _baGuaWheel.DropOffDiscs(type); SelectAction(action); } else if (!_baGuaWheel.HasAValidMove(_currentPlayer, this)) { _baGuaWheel.DropOffDiscs(type); SkipAction(); } ; }
internal void RequestToDropDiscs(BaGuaElementType type) { GameEngine.RequestToDropOffDiscs(type); }
public BaGuaElement DetermineAction(BaGuaElementType type) { var element = GetElement(type); return(DetermineActionFor(element)); }
public bool HasDiscsAt(BaGuaElementType type) { var element = GetElement(type); return(element.NumberOfDiscs != 0); }
private BaGuaElement GetElement(BaGuaElementType type) { return(_elements.Where(e => e.Type == type).First()); }