Example #1
0
 public void Construct(DiContainer _container, FIDefaultRequest _server, GDManager _staticData)
 {
     container  = _container;
     server     = _server;
     staticData = _staticData;
     serverData = (container.Resolve <IDataProvider>() as FIFakeServerDataProvider).srcContainer;
 }
Example #2
0
 protected override void Awake()
 {
     base.Awake();
     easy         = container.Resolve <FIEasy>();
     runtimeData  = container.Resolve <IRuntimeData>();
     sprite       = container.Resolve <FISpriteData>();
     popupManager = container.Resolve <FIPopupManager>();
     staticData   = container.Resolve <GDManager>();
 }
 public override void InstallBindings()
 {
     if (manager == null)
     {
         manager = new GDManager();
         manager.LoadFromXml(new GDInstCreator(), textAsset.text);
     }
     Container.Bind <GDManager>().FromInstance(manager).AsSingle();
     Container.Resolve <GDManager>();
 }
Example #4
0
        protected override void Initialize()
        {
            IsMouseVisible = true;
            GDManager.SynchronizeWithVerticalRetrace = true;
            GDManager.PreferredBackBufferWidth       = WINDOW_SIZE_X;
            GDManager.PreferredBackBufferHeight      = WINDOW_SIZE_Y;

            IsFixedTimeStep = true;
            GDManager.ApplyChanges();
            base.Initialize();
        }
Example #5
0
    //Ref
    public static T GetRefFromAttrib <T>(this XElement xml, GDManager manager, string name) where T : GDDataBase
    {
        var value = xml.TryGetAttrib(name);

        if (value == null)
        {
            throw new Exception("There is no attrib value!");
        }

        int instID = System.Convert.ToInt32(value.Value);

        if (instID == 0)
        {
            return(null);
        }
        return(manager.GetByID <T>(instID));
    }
Example #6
0
    public static List <T> GetRefFromAttribArr <T>(this XElement xml, GDManager manager, string name) where T : GDDataBase
    {
        List <T> tempList = new List <T>();

        var value = xml.TryGetAttrib(name);

        if (value == null)
        {
            return(tempList);
        }

        foreach (var item in value.Elements())
        {
            int instID = System.Convert.ToInt32(item.Value);
            tempList.Add(manager.GetByID <T>(instID));
        }
        return(tempList);
    }
Example #7
0
        protected override void Initialize()
        {
            IsMouseVisible = true;
            GDManager.SynchronizeWithVerticalRetrace = true;
            IsFixedTimeStep = true;

            //GDManager.IsFullScreen = false;
            //ViewPortWidth = GDManager.PreferredBackBufferWidth = GDManager.GraphicsDevice.DisplayMode.Width / 2;
            //ViewPortHeight = GDManager.PreferredBackBufferHeight = GDManager.GraphicsDevice.DisplayMode.Height / 2;

            ViewPortWidth          = GDManager.PreferredBackBufferWidth = GDManager.GraphicsDevice.DisplayMode.Width;
            ViewPortHeight         = GDManager.PreferredBackBufferHeight = GDManager.GraphicsDevice.DisplayMode.Height;
            GDManager.IsFullScreen = true;

            GDManager.ApplyChanges();

            simplexNoiseColors = new Color[ViewPortWidth / DIVISOR * ViewPortHeight / DIVISOR];
            IsMouseVisible     = true;
            circlesYay         = new ThatCoolCircleThing(ViewPortWidth, ViewPortHeight, RNG);
            base.Initialize();
        }
Example #8
0
    public void SetLackResourcePopup(GDManager staticData, Tuple <int, int>[] lackList, System.Action <FIPopupDialog, int> onConfirm)
    {
        Title = "재료부족";
        System.Text.StringBuilder builder = new System.Text.StringBuilder();
        builder.AppendLine("재료를 구매할까요?\n");
        int totalDia = 0;

        foreach (var item in lackList)
        {
            var itemData = staticData.GetByID <GDItemData>(item.Item1);
            totalDia += itemData.diaPrice * item.Item2;
            builder.AppendLine(string.Format("item_{0}{1}", itemData.imageName, item.Item2));
        }
        Desc = builder.ToString();
        SetBtnCnt(2);
        BtnOneText = "item_diaPoint" + totalDia.ToString();
        BtnTwoText = "취소";
        BtnOneObservable.Subscribe(_ => {
            onConfirm(this, totalDia);
        });
        BtnTwoObservable.Subscribe(_ => {
            DestroyPopup();
        });
    }
Example #9
0
 public override void LoadReferences(GDManager manager, XElement xml)
 {
     item = xml.GetRefFromAttrib <GDItemData>(manager, "item");
 }
Example #10
0
 public override void LoadReferences(GDManager manager, XElement xml)
 {
     unlockCondArr = xml.GetRefFromAttribArr <GDConditionData>(manager, "unlockCondArr");
 }
Example #11
0
 public override void LoadReferences(GDManager manager, XElement xml)
 {
     buffArr = xml.GetRefFromAttribArr <GDBuff>(manager, "buffArr");
 }
Example #12
0
 public override void LoadReferences(GDManager manager, XElement xml)
 {
     unlockReq = xml.GetRefFromAttrib <GDAchievementData>(manager, "unlockReq");
 }
Example #13
0
 public GDItemData GetItem(GDManager staticData)
 {
     return(staticData.GetByID <GDItemData>(itemID));
 }
Example #14
0
 public int CalcOrderRewardExp(GDManager staticData)
 {
     return(staticData.GetByKey <GDEdibleItemData>(this.GetItem(staticData).key).rewardUserExp *this.itemCnt);
 }
Example #15
0
 public override void LoadReferences(GDManager manager, XElement xml)
 {
     table = xml.GetRefFromAttrib <GDCraftingTable>(manager, "table");
 }
Example #16
0
        protected override void Update(GameTime gameTime)
        {
            updateTimeStep = gameTime.ElapsedGameTime.TotalMilliseconds / 1000d;
            InputHandler.Update(Mouse.GetState(), Keyboard.GetState());
            InputHandler.GenerateCommands();
            // Call game logic on this.Commands to get input data.

            foreach (KeyboardCommand c in InputHandler.KeyCommands)
            {
                switch (c.Button)
                {
                case Keys.Escape:
                    Exit();
                    return;

                case Keys.F4:
                    if (c.State == InputState.Pressed)
                    {
                        Options.LargeResolution = !Options.LargeResolution;
                    }
                    break;
                }
            }

            if (_isLargeReso != Options.LargeResolution)
            {
                //Determines the maximum usable resolution judged by the GraphicsDevice bounds.
                if (GDManager.GraphicsDevice.DisplayMode.Width < Options.RESOLUTION_LARGE.X ||
                    GDManager.GraphicsDevice.DisplayMode.Height < Options.RESOLUTION_LARGE.Y)
                {
                    Options.CanHandleLargeReso = false;
                }

                //If the resolution setting is higher than the graphics device can handle, change the option to the usable maxReso.
                if (Options.LargeResolution && !Options.CanHandleLargeReso)
                {
                    Options.LargeResolution = false;
                }

                GDManager.PreferredBackBufferWidth  = Options.GetBackBufferWidth();
                GDManager.PreferredBackBufferHeight = Options.GetBackBufferHeight();
                GDManager.IsFullScreen = Options.LargeResolution;
                GDManager.ApplyChanges();
                _isLargeReso = Options.LargeResolution;
            }

            // If the choicemaker is not active, update the stage. Otherwise don't do anything.
            if (!SorryScreen.Update(updateTimeStep))
            {
                if (!ChoiceMaker.Update(updateTimeStep))
                {
                    CurrentStage.Update(updateTimeStep);
#if DEBUG
                    // Preprocessor directive removes this function in Release/AnyCPU Configuration.
                    foreach (MouseCommand c in InputHandler.MouseCommands)
                    {
                        //CurrentStage.Player.ActualCoords.X = c.Position.X + CurrentStage.Camera.Location.X;
                        //CurrentStage.Player.ActualCoords.Y = c.Position.Y + CurrentStage.Camera.Location.Y;
                        //CurrentStage.Player.Position = new Rectangle(c.Position, CurrentStage.Player.Position.Size);
                        //CurrentStage.Player.LastPosition = CurrentStage.Player.Position;
                        //CurrentStage.Player.ActualVelocity.X = 0;
                        //CurrentStage.Player.ActualVelocity.Y = 0;
                        if (!CurrentStage.ChoiceMade && Game.Manager.ChoiceMaker.Initialized)
                        {
                            Game.Manager.ChoiceMaker.Active = true;
                        }
                        else
                        {
                            CurrentStage.LoadNextLevel();
                        }
                    }
#endif
                }
            }

            base.Update(gameTime);
        }
Example #17
0
        protected override void Update(GameTime gameTime)
        {
            zOff += zOffsetInc;

            _prevMousePos = _currMousePos;
            _currMousePos = Mouse.GetState().Position.ToVector2();
            xOff          = 0;

            //for (int i = 0; i < (ViewPortWidth / DIVISOR); i++) {
            //	xOff += xIncrement;
            //	double yOff = 0;
            //	for (int j = 0; j < (ViewPortHeight / DIVISOR); j++) {
            //		yOff += yIncrement;
            //		double value = Noise.Evaluate(xOff, yOff, zOff);

            //		int val = ValueMapper.Map(value, -0.7, 1, 0, 360);
            //		int index = j * (ViewPortWidth / DIVISOR) + i;
            //		simplexNoiseColors[index] = HSV.ColorFromHue(val);
            //	}
            //}

            if (Mouse.GetState().LeftButton == ButtonState.Pressed)
            {
                if (_prevMousePos == null)
                {
                    return;
                }

                //_components.Add(new LineSegment() {
                //	StartPos = _currMousePos,
                //	EndPos = _prevMousePos,
                //	Color = HSV.ColorFromHue(RNG.Next(0, 360))
                //});

                //_components.Add(new Circle() {
                //	Radius = 20,
                //	Position = _currMousePos,
                //	Color = HSV.ColorFromHue(RNG.Next(0, 360))
                //});
            }

            KeyboardState state = Keyboard.GetState();

            if (state.IsKeyDown(Keys.Up))
            {
                yIncrement += 0.001;
            }
            if (state.IsKeyDown(Keys.Down))
            {
                yIncrement -= 0.001;
            }
            if (state.IsKeyDown(Keys.Left))
            {
                xIncrement -= 0.001;
            }
            if (state.IsKeyDown(Keys.Right))
            {
                xIncrement += 0.001;
            }
            if (state.IsKeyDown(Keys.NumPad8))
            {
                zOffsetInc += 0.001;
            }
            if (state.IsKeyDown(Keys.NumPad2))
            {
                zOffsetInc -= 0.001;
            }


            foreach (Component item in _components)
            {
                item.Update(gameTime);
            }

            if (Mouse.GetState().RightButton == ButtonState.Pressed)
            {
                _components.Clear();
                circlesYay.Clear();
            }

            if ((state.IsKeyDown(Keys.LeftAlt) || state.IsKeyDown(Keys.RightAlt)) && state.IsKeyDown(Keys.Enter))
            {
                if (GDManager.IsFullScreen)
                {
                    GDManager.IsFullScreen = false;
                    ViewPortWidth          = GDManager.PreferredBackBufferWidth = GDManager.GraphicsDevice.DisplayMode.Width / 2;
                    ViewPortHeight         = GDManager.PreferredBackBufferHeight = GDManager.GraphicsDevice.DisplayMode.Height / 2;
                    GDManager.ApplyChanges();
                }
                else
                {
                    ViewPortWidth          = GDManager.PreferredBackBufferWidth = GDManager.GraphicsDevice.DisplayMode.Width;
                    ViewPortHeight         = GDManager.PreferredBackBufferHeight = GDManager.GraphicsDevice.DisplayMode.Height;
                    GDManager.IsFullScreen = true;
                    GDManager.ApplyChanges();
                }
            }

            circlesYay.Update(gameTime);

            base.Update(gameTime);
        }
Example #18
0
 public override void LoadReferences(GDManager manager, XElement xml)
 {
     rewardArr = xml.GetRefFromAttribArr <GDCostItemInfo>(manager, "rewardArr");
 }
Example #19
0
 public override void LoadReferences(GDManager manager, XElement xml)
 {
     interior = xml.GetRefFromAttrib <GDInterior>(manager, "interior");
 }
Example #20
0
 public virtual void LoadReferences(GDManager manager, XElement xml)
 {
 }
Example #21
0
 public override void LoadReferences(GDManager manager, XElement xml)
 {
 }
Example #22
0
 public int CalcOrderPrice(GDManager staticData)
 {
     return(GetItem(staticData).GetOrderPrice(itemCnt));
 }