Example #1
0
 public void CheckBoardStateLoop()
 {
     SetNextActorControl();
     //need to, while moving, lock it
     //if someone is moving dont execute below
     //this needs to be futzed with the AP thing isnt quiiiite working
     ActiveBoard.HighlightHex(ActiveActor.Location);
     if (ActiveActor.Controllable)
     {
         if (ActiveActor.TurnState == ActorTurnState.WaitingForTurn)
         {
             ActiveActor.StartTurn();
         }
         HandleMouse.TacticalViewMouseHandle(ActiveBoard, Camera, ActiveActor);
     }
     else
     {
         ActiveActor.StartTurn();
         ActiveActor.UseAIMoveAction();
     }
 }
Example #2
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            HandleMouse.SetMouseState(this);
            var mouseLoc = HandleMouse.RelativeMouseLocation;

            GameCamera.UpdateCamera(this.GraphicsDevice.Viewport, mouseLoc);

            SpriteBatch.Begin(transformMatrix: GameCamera.Transform, sortMode: SpriteSortMode.Deferred);

            GraphicsDevice.Clear(Color.LawnGreen);
            BoardState.ActiveBoard.Draw();
            #region ray test
            //if (BoardState.ActiveBoard.DebugLines.Any())
            //{
            //    BoardState.ActiveBoard.DebugLines.ForEach(l =>
            //    {
            //        l.DrawDebugStrings();
            //        l.Line.Draw();
            //    });
            //    //var debugRay = BoardState.ActiveBoard.DebugLines[debugRayIndex];
            //    //debugRay.Line.Draw();
            //    //debugRay.DrawDebugStrings();
            //    //;
            //}
            #endregion

            foreach (var hexUI in ActiveHexUIElements.AvailibleUIElements)
            {
                hexUI.Value.Draw();
            }
            //ActorActions.Draw(gameTime.ElapsedGameTime.TotalMilliseconds);
            BoardState.CheckBoardStateLoop();

            ;
            //should be moved somewhere else... :TODO

            SpriteBatch.End();
            // base.Draw(gameTime);
        }
Example #3
0
 public void SetGameObject(GameObject go, HandleMouse _m)
 {
     this.go = go;
     _m.SetCard(this);
     _HandleMouse = _m;
     originalScale = go.transform.localScale;
     _HandleEffects = (HandleEffects)go.GetComponent("HandleEffects");
 }
Example #4
0
 public void linkGameObjectToCard(GameObject go, HandleMouse _m,  int index)
 {
     cards[index].SetGameObject(go, _m);
 }