Advertisement
Guest User

sample

a guest
Jan 18th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5.  
  6. public class TesteA : MonoBehaviour {
  7.  
  8.     public List<ItemClass> List = new List<ItemClass>();
  9.     public List<int> numbers = new List<int>();
  10.    
  11.     string VerificarNumeros () {
  12.  
  13.         for (int i = 0; i < List.Count; i++)
  14.             if (List[i].nList.Intersect(numbers).ToList().Count == numbers.Count)
  15.                 return "sequencia encontrada no index " + i;
  16.            
  17.         return "sequencia não econtrada";
  18.     }
  19.  
  20.     void Start() { print(VerificarNumeros()); }
  21. }
  22.  
  23. [System.Serializable]
  24. public class ItemClass
  25. {
  26.     public int Item;
  27.     public string Date;
  28.     public List<int> nList = new List<int>();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement