Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在用 java 制作多人游戏,它有连接到主服务器的客户端。我目前正在以 JSON 格式保存玩家游戏,文件名与玩家姓名相同。我想知道是否有更好的方法可以做到这一点。
我需要存储数组、布尔值、整数和字符串。
每当玩家在游戏中更改某些内容(例如拾取物品)时,该文件都会保存到。
我通常通过 CSS 设置固定的列宽,结果完美无瑕:
#tableID thead tr th:nth-child(1){width: 75px;} #tableID thead tr th:nth-child(2){width: 75px;} /* etc… */
但是现在我处于一种情况,直到运行时我才知道所需的列宽。这是我用来动态设置列宽的代码的摘录: