protected override void InternalInitializeLayer(World world, ALevelNode levelNode) { this.cardPicked = null; this.cardFocused = null; this.domainFocused = null; this.playerTurn = null; this.nbCardsToPlace = 0; this.StarSystem.Clear(); this.StarLinkSystem.Clear(); this.StarToLinks.Clear(); this.StarDomains.Clear(); //this.DeactivatedCardEntities.Clear(); this.CardsOffBoard.Clear(); this.PendingActions.Clear(); this.NameToOnBoardCardEntities.Clear(); GalaxyFactory.NameToGalaxyCreators[this.PreInitGalaxyName](this); FloatRect galaxyArea = this.GetGalaxyArea(); (levelNode as CardBoardLevel).BoardBackgroundLayer.Position = new Vector2f(galaxyArea.Left + galaxyArea.Width / 2f, galaxyArea.Top + galaxyArea.Height / 2f) * (1 / 0.75f); (levelNode as CardBoardLevel).BoardBackgroundLayer.StartingArea = new Vector2f(galaxyArea.Width + 1000, galaxyArea.Height + 1000); }
protected override void InternalInitializeLayer(World world, ALevelNode levelNode) { this.NotifBehaviorsList = new List <IBoardNotifBehavior>(); this.CurrentNotifBehavior = null; this.cardAwakened = null; }
public virtual void InitializeLayer(World world, ALevelNode levelNode) { this.ownerLevelNode = levelNode; this.raiseEntityEvents = false; this.InternalInitializeLayer(world, levelNode); this.raiseEntityEvents = true; }
public virtual void FlushLayer() { this.ownerLevelNode = null; foreach (AEntity entity in this.entities) { entity.Dispose(); this.NotifyObjectRemoved(entity); } this.entities.Clear(); }
public ALayer() { this.TypesInChunk = new HashSet <Type>(); this.entities = new HashSet <AEntity>(); this.position = new Vector2f(0, 0); this.rotation = 0; this.StartingArea = null; this.ownerLevelNode = null; this.raiseEntityEvents = true; this.ParentLayer = null; }
public void InitializeLevel(List <string> layersToAdd, ALevelNode levelNode) { this.currentLayers.Clear(); foreach (string layerName in layersToAdd) { if (this.loadedLayers.ContainsKey(layerName)) { this.currentLayers.Add(this.loadedLayers[layerName]); } } foreach (ALayer layer in this.currentLayers) { layer.InitializeLayer(this, levelNode); } this.NotifyLevelStarting(); }
protected override void InternalInitializeLayer(World world, ALevelNode levelNode) { this.currentTurnCount = 1; this.TurnIndex = -1; CardBoardLevel cardBoardLevel = levelNode as CardBoardLevel; this.Player = cardBoardLevel.MainPlayer; this.Opponent = cardBoardLevel.Opponent; this.PlayerTurn = this.Player; this.ToolTip = new ToolTipEntity(this); this.AddEntityToLayer(this.ToolTip); this.PlayerNameToTotalScores = new Dictionary <string, List <int> >(); this.PlayerNameToTotalScores.Add(this.Player.PlayerName, new List <int>()); this.PlayerNameToTotalScores.Add(this.Opponent.PlayerName, new List <int>()); this.ClearModifiers(); }
protected override void InternalInitializeLayer(World world, ALevelNode levelNode) { int i = 0; this.CardsDeck.Clear(); this.CardsHand.Clear(); this.CardsCemetery.Clear(); this.isCemeteryShowed = false; this.isHandShowed = true; this.pileFocused = PileFocused.HAND; this.pilePicked = PileFocused.NONE; this.IsActiveTurn = false; this.SupportedPlayer = (levelNode as CardBoardLevel).GetPlayerFromIndex(world, out int currentPlayerIndex); this.IndexPlayer = currentPlayerIndex; List <Card.Card> deckCards = this.SupportedPlayer.ConstructDeck(world.CardLibrary); foreach (Card.Card card in deckCards) { CardEntity cardEntity = new CardEntity(this, card, false); cardEntity.Position = this.DeckPosition; cardEntity.IsActive = i < TOP_DECK; this.CardsDeck.Add(cardEntity); this.AddEntityToLayer(cardEntity); i++; } this.nbCardsToDraw = 0; this.cardFocused = null; }
protected override void InternalInitializeLayer(World world, ALevelNode levelNode) { }
protected override void InternalInitializeLayer(World world, ALevelNode levelNode) { this.currentImageId = this.PreInitImageId; }
protected abstract void InternalInitializeLayer(World world, ALevelNode levelNode);