private void CreateSpaces() { for (int spaceIndex = 1; spaceIndex <= 9; spaceIndex++) { Spaces.Add(new BoardCardSpace(spaceIndex)); } }
private void CreateSpaces(MainWindow mainWindow) { for (int spaceIndex = 1; spaceIndex <= 9; spaceIndex++) { Spaces.Add(new BoardCardSpace(spaceIndex, mainWindow)); } }
public void AddCar(CarOwner car, int spaceId, int levelId) { SpaceId = spaceId; LevelId = levelId; car.SpaceId = spaceId; car.SpaceLevel = levelId; Spaces.Add(this); CarOwners.Add(car); }
/// <summary> /// Private Methods /// </summary> void Init() { for (int i = 0; i < Size; i++) { Spaces.Add(new List <Space>()); for (int j = 0; j < Size; j++) { Spaces[i].Add(new Space(new Vector3(i, j), i * Size + j)); } } }
/// <summary> /// Adds a space to the collection of spaces. /// </summary> /// <param name="obj"></param> public override void Add(object obj) { Ensure.ArgumentNotNull(obj, "obj"); Spaces.Add(obj as Space); }
public void AddSpace(ObservationSpace observationSpace) { observationSpace.Dock = DockStyle.Left; this.Controls.Add(observationSpace); Spaces.Add(observationSpace); }
public void SetMasterSpace() { Spaces.Add(new Rect { Width = Master.Width, Height = Master.Height, X = 0, Y = 0 }); }
public void AddSpace(Space space) { Spaces.Add(space); }
public void __init__(int c) { Spaces.Add(new CardGameTableSpace(new CardGameTableSpaceOptions() { Name = "clubs" })); Spaces.Add(new CardGameTableSpace(new CardGameTableSpaceOptions() { Name = "spades" })); Spaces.Add(new CardGameTableSpace(new CardGameTableSpaceOptions() { Name = "hearts" })); Spaces.Add(new CardGameTableSpace(new CardGameTableSpaceOptions() { Name = "diamonds" })); TextAreas.Add(new GameCardGameTextArea(new GameCardGameTextAreaOptions() { Name = "clubs" })); TextAreas.Add(new GameCardGameTextArea(new GameCardGameTextAreaOptions() { Name = "spades" })); TextAreas.Add(new GameCardGameTextArea(new GameCardGameTextAreaOptions() { Name = "hearts" })); TextAreas.Add(new GameCardGameTextArea(new GameCardGameTextAreaOptions() { Name = "diamonds" })); Users.Add(new CardGameUser("Joe")); Users.Add(new CardGameUser("Mike")); Users.Add(new CardGameUser("Chris")); Users.Add(new CardGameUser("Steve")); for (int index = 0; index < 6; index++) { Spaces.Add(new CardGameTableSpace(new CardGameTableSpaceOptions() { Name = "User" + index })); TextAreas.Add(new GameCardGameTextArea(new GameCardGameTextAreaOptions() { Name = "User" + index })); } Size = new Size(15, 15); NumberOfCards = 52; NumberOfJokers = 0; ConfigurationCompleted(); }
public void AddSpace(Space space) { Spaces.Add(space); space.BoardReference = this; }
public bool Insert(RectWH imagerect, out RectFlipXYWH outresult, Action <SpaceRect> reportCandidateEmptySpace = null) { for (int i = Spaces.Count - 1; i >= 0; i--) { var candidateSpace = Spaces[i]; reportCandidateEmptySpace?.Invoke(candidateSpace); RectFlipXYWH AcceptResult(CreatedSplits splits, bool flippingNecessary) { Spaces.Remove(i); for (int s = 0; s < splits.Count; s++) { Spaces.Add(splits.Spaces[s]); } var result = new RectFlipXYWH( candidateSpace.X, candidateSpace.Y, imagerect.Width, imagerect.Height, AllowFlip && flippingNecessary, imagerect.Attachment ); CurrentAABB = CurrentAABB.ExpandWith <RectWH, RectFlipXYWH>(result); return(result); } CreatedSplits TryToInsert(RectWH img) => CreatedSplits.InsertAndSplit(img, candidateSpace); if (AllowFlip) { var normal = TryToInsert(imagerect); var flipped = TryToInsert(imagerect.Flip()); if (normal && flipped) { outresult = flipped.BetterThan(normal) ? AcceptResult(flipped, true) : AcceptResult(normal, false); return(true); } if (normal) { outresult = AcceptResult(normal, false); return(true); } if (flipped) { outresult = AcceptResult(flipped, true); return(true); } } else { var normal = TryToInsert(imagerect); if (normal) { outresult = AcceptResult(normal, false); return(true); } } } outresult = new RectFlipXYWH(); return(false); }
public void Reset(RectWH r) { CurrentAABB = new RectWH(); Spaces.Reset(); Spaces.Add(new SpaceRect(r)); }
public void Add(Vector2 position) { Spaces.Add(position); Objects.Add(null); }