在图片框控件中动态循环遍历层 [英] dynamically loop through tiers in picturebox control

查看:59
本文介绍了在图片框控件中动态循环遍历层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我正在尝试制作一个魔兽世界系统的.exe版本。人才建设者。我希望没有人指出并笑得太多......但无论如何,这就是我遇到的问题...


Theres 11层我的PictureBox [ ]控制,总共44。第一层是免费虽然每个后续层需要5个点进入上一层才能使下一层可用。


现在我有意将此代码放入TextChanged()事件处理程序中积分持有人(标签)。此循环将在每次放入或取出一个点时进行检查,并根据所有11个层中的点数组合启用或禁用层。


我很难想你如何制作一个动态循环,以便能够在X点被放入其中后手动编码每一层开放......


我知道这个游戏要么被爱还是被恨,但我正在学习基于这个项目的C#。所以我希望我能在没有任何批评的情况下得到一些帮助。


谢谢...

解决方案

< blockquote>嘿,作为魔兽世界的玩家,我跟仇恨者说话! :P很高兴看到你还在为此工作,实际上。


我不知道你的意思。你为什么需要循环?当你点击某个天赋时,你不能只在那里进行检查并根据该事件启用/禁用其他天赋吗?一些快速的伪...

展开 | 选择 | Wrap | 行号


基本上这个小理论实际上是给我的。


Theres 44树中的天赋。所以每4个人才是1层。

当前等级=(总积分/ 5)+ 1


变更:

- 检查点

- 循环访问当前层,然后查看是否可以启用或禁用下一层,基于当前点数。

- 根据需要启用和禁用。


我有网站版的官方代码。但老实说,不知道如何将其推向我正在做的事情。大声笑


这是Javascript btw,我正在向我理解的区域添加评论...

展开 | 选择 | 换行 | 行号


啊,我误解了你的依赖意味着什么。我只想到了箭头:)


我真的不太了解Web开发,但是这个循环看起来像是在更改点时更新整个树,是正确吗?


那个循环确实看起来非常简单...如果它的等级小于树中的总点数除以每层的点数,那就启用一个人才。


您不确定如何将其转换为C#?


Ok so, I''m trying to make an .exe version of a World of Warcraft system. The Talent builder. I''m hoping that no one points and laughs too much... But anyways, this is the problem I''m having...

Theres 11 tiers of my PictureBox[] Control, 44 total. The 1st tier is "Free" while each subsequent tier needs 5 points into the previous tier to make the next tier available.

Right now I have the intentions of putting this code into a TextChanged() event handler on the total points holder (a Label). And this loop will check each time a point is put in, or taken out, and enable or disable a tier based on the amount of points that are in all of the 11 tiers combined.

I''m having a really hard time figuring you how to make a dynamic loop to be able to do this with out manually code each tier opening up after X points were placed into it...

I know the game is either loved or hated, but I''m learning C# based on this project. So I''m hoping that I can get some help with this loop without any criticism.

Thanks...

解决方案

Hey, as a fellow WoW player I say to heck with the haters! :P Glad to see you''re still working on this, actually.

I''m not sure what you mean here though. Why do you need a loop? When you click a certain talent, couldn''t you just do the checks there and enable/disable other talents based on that event? Some quick pseudo...

Expand|Select|Wrap|Line Numbers


Well basicly what little theory is actually coming to me is this.

Theres 44 Talents in the tree. So every 4 talents is 1 tier.
Current Tier = (Total Points / 5) + 1

On Change:
- Check Points
- Cycle through current tier and next to see if next tier can be enabled or disabled, based current amount of points.
- enable and disable as needed.

I have the offical code for the website version. But honestly, not sure how to push that to exactly what I''m doing. lol

This is Javascript btw, and i''m adding comments to the areas I understand...

Expand|Select|Wrap|Line Numbers


Ah, I misunderstood what you meant by dependency. I was thinking of just the arrows :)

I don''t really know web development much, but that loop looks like it updates the whole tree when a point is changed, is that correct?

That loop does seem pretty straight forward... enable a talent if it''s tier is less than the total number of points in the tree divided by the points per tier.

Are you not sure how to convert this to C#?


这篇关于在图片框控件中动态循环遍历层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆