在Gridworld中更改Gridpanel类 [英] Changing the Gridpanel class in Gridworld

查看:84
本文介绍了在Gridworld中更改Gridpanel类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照.我已经为我的gridworld jar文件导入了源代码. IE.如果愿意,我可以去看看Bug.class或Gridpanel.class.但是,我无法编辑这些文件以产生pdf建议的结果.我该怎么做呢?我是否错误地导入了源代码?

I am trying to follow the steps to change the Gridworld appearance according to this. I've already imported source code for my gridworld jar file; ie. I can go and look at Bug.class or Gridpanel.class if I wanted to. However, I can't edit these files to produce the results that that pdf suggests. How do I do this? Did I import the source code incorrectly?

推荐答案

我认为您无法编辑外部资源,例如gridworld.jar.您将需要创建4个新软件包:

I don't think you can edit an external resource like gridworld.jar. You are going to need to create 4 new packages:

  • 演员
  • 网格
  • gui
  • 世界

然后将类文件从gridworld.jar包复制到相应的文件中.现在您可以编辑文件.确保包括所有可能也包含在gridworld.jar软件包中的杂项文件,这些文件很重要.

Then copy the class files from gridworld.jar packages into your corresponding ones. Now you can edit the files. Make sure you include any miscellaneous files that might also be in the gridworld.jar packages, their important.

使用您自己的软件包,您不再需要gridworld.jar外部资源,并且导入语句有所不同.代替

With your own packages you no longer need the gridworld.jar external resource, and there is a difference in your import statements. Instead of

import gridworld.actor.Actor;

执行此操作:

import actor.Actor;

注意:您将需要更改新程序包类中的所有import语句,以引用其他新程序包.我相信还有一些错误,不是项目中断,而是我添加了抑制器.

Note: You will need to change all of the import statements in the new package classes to reference the other new packages. I believe that there were also some errors, not project breaking, but I just added suppressors.

这篇关于在Gridworld中更改Gridpanel类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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