Skip to content

What Happened to retro

Hileb edited this page Aug 13, 2024 · 3 revisions

Imagine a situation like this:

The restaurant has an original menu. When a customer needs to view the menu, the restaurant will copy a copy of the menu for him. There is an operation that can make the process faster: directly use the original for the customer. But the disadvantages of this operation are also obvious. The customer may modify the menu.

Now, in reality, the menu is Enum, and the object we operate is VALUES. We directly pass the original to the demander without making a safer copy, which is the price of speed. The redirector is not designed for a specific Enum, and we don’t know how many customers there are before running, so we can only hope that players can block those customers who will destroy the original menu through the configuration file.

设想一个这样的情况:

餐厅有一个菜单的原本,当客户需要查看菜单时,餐厅会抄录一份菜单给他。有一个操作可以让过程变得更快:直接给客户使用原本。但这个操作带来的弊端也是显而易见的,客户有可能修改菜单。

现在,实际情况,菜单就是Enum,我们操作的对象就是VALUES,我们直接将原本传递到需求者而不进行更安全的拷贝,这是速度的代价。模组并不为某个具体问题设计,运行前也不知道有多少客户,所以我们只能希望玩家可以通过配置文件屏蔽掉那些会破坏菜单原本的客户。

Clone this wiki locally