Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a pattern for this?

i have something that requires a matrix of values, similar to pokemon:

pokemon
(source: firechao.com)

i have a class object for each of the types, is there a pattern or a good way to implement this, as a middle layer or in the classes?

like image 345
Timmy Avatar asked Apr 13 '10 15:04

Timmy


People also ask

What are 3 examples of a pattern?

Few examples of numerical patterns are: Even numbers pattern -: 2, 4, 6, 8, 10, 1, 14, 16, 18, … Odd numbers pattern -: 3, 5, 7, 9, 11, 13, 15, 17, 19, … Fibonacci numbers pattern -: 1, 1, 2, 3, 5, 8 ,13, 21, … and so on.

What are examples of patterns?

The definition of a pattern is someone or something used as a model to make a copy, a design, or an expected action. An example of a pattern is the paper sections a seamstress uses to make a dress; a dress pattern. An example of a pattern is polka dots. An example of a pattern is rush hour traffic; a traffic pattern.

What is the pattern of the number?

What are Number Patterns? In Mathematics, number patterns are the patterns in which a list number that follows a certain sequence. Generally, the patterns establish the relationship between two numbers. It is also known as the sequences of series in numbers.


1 Answers

Why make it so complicated - For the sake of maintenance make it like it looks. A two dimensional array will do fine and since it is static will give you best lookup performance - You then just need a way to go from Name/Type to array index.

like image 134
Romain Hippeau Avatar answered Jan 02 '23 17:01

Romain Hippeau



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!