コード例 #1
0
 public void AddToTeam(UnitComponent myComp)
 {
     unitCompList.Add(myComp);
     unitEntityList.Add(myComp._parent);
 }
コード例 #2
0
        public void CreateUnit(Vector2 myCoordinate, Texture2DFramed myFramedTexture, UnitData myUnitData)
        {
            HexComponent hexComp = GetHex(myCoordinate);

            if (hexComp.GetUnit() == null)
            {
                SpriteComponent hexSprite = GetHex(myCoordinate)._parent.GetDrawable("SpriteComponent") as SpriteComponent;

                Entity unitEntity = new Entity(15, State.ScreenState.SKIRMISH);

                AnimatedSpriteComponent unitSprite = new AnimatedSpriteComponent(true, hexSprite.GetCenterPosition(), myFramedTexture);

                unitEntity.AddComponent(unitSprite);

                UnitComponent unitComp = new UnitComponent(GetHex(myCoordinate), true);
                unitComp.SetUnitData(myUnitData);
                unitEntity.AddComponent(unitComp);

                EntityManager.AddEntity(unitEntity);

                alliedUnitList.Add(unitEntity);
                totalUnitList.Add(unitEntity);

                hexComp.SetUnit(unitComp);
                UpdateVisibilityAllies();
            }
            else
            {
                throw new Exception("There is already a unit where you are trying to create one.");
            }
        }
コード例 #3
0
 public void AddToSeenUnitList(UnitComponent unit)
 {
     seenUnitList.Add(unit);
 }
コード例 #4
0
 public void AddToKnownUnitList(UnitComponent unit)
 {
     knownUnitList.Add(unit);
 }
コード例 #5
0
        public static void Initialize()
        {
            State.screenState = State.ScreenState.WORLD_MAP;
            State.selectionState = State.SelectionState.NoSelection;
            State.battleState = State.BattleState.Attack;

            State.screenWidth = 0;
            State.screenHeight = 0;

            State.dialoguePosition = 0;//Which textbox you're in
            State.dialogueChoicePosition = 0;
            State.displayedDialogueMessage = "";

            State.dialogueLinePosition = 0;
            State.dialogueWordPosition = 0;
            State.dialogueCharacterPosition = 0;

            State.firstDialogueWord = "";
            State.lastTimeDialogueChecked = 0;
            State.messageBegin = false;
            State.currentDialogueMessage = new List<string>();

            State.originalHexClicked = null;

            State.currentAttacker = null;
            State.currentDefender = null;

            State.battleMessage = "";

            State.attackerBattleStatus = BattleStatus.NoStatus;
            State.defenderBattleStatus = BattleStatus.NoStatus;

            State.enemyMoveIndex = 0;
            State.firstTimeEnemyTurn = true;

            State.elapsedTimeForMove = 0;

            State.font = null;
        }
コード例 #6
0
 public void SetUnit(UnitComponent myUnit)
 {
     unit = myUnit;
 }
コード例 #7
0
 public void RemoveUnit()
 {
     unit = null;
 }