Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Modding:Migrate to Stardew Valley 1.6
(view source)
Revision as of 16:12, 28 February 2024
12 bytes added
,
28 February
→Inventory class
:
prefer clear argument names
Line 2,686:
Line 2,686:
<syntaxhighlight lang="c#">
<syntaxhighlight lang="c#">
// exact name
// exact name
−
bool hasMatch = Game1.player.Items.Any(
p
=>
p
?.Name == name);
+
bool hasMatch = Game1.player.Items.Any(
item
=>
item
?.Name == name);
// name contains
// name contains
−
bool hasMatch = Game1.player.Items.Any(
p
=>
p
?.Name?.Contains(name) is true);
+
bool hasMatch = Game1.player.Items.Any(
item
=>
item
?.Name?.Contains(name) is true);
</syntaxhighlight>
</syntaxhighlight>
|-
|-
Pathoschild
translators
8,438
edits
Navigation menu
Personal tools
Create account
Log in
Namespaces
Modding
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Admin noticeboard
Help Editing
Random page
Official Links
Official Site
Official Forums
Official Merchandise
Discord
Reddit
Tools
Upload file
Special pages
Printable version