コード例 #1
0
        //zwraca listę informacji o wszystkich statkach na planszy 'boardId'
        static public unsafe List <ShipInfo> getShipList(int boardId)
        {
            int shipCount = DllImports.getShipCount(boardId);

            ShipInfo[] tab = new ShipInfo[shipCount];
            fixed(void *ptr = &tab[0])
            {
                DllImports.getShipList(new IntPtr(ptr), boardId);
            }

            List <ShipInfo> list = new List <ShipInfo>(shipCount);

            foreach (ShipInfo k in tab)
            {
                list.Add(k);
            }
            return(list);
        }
コード例 #2
0
 //zwraca liczbę statków na planszy 'boardId'
 static public int getShipCount(int boardId)
 {
     return(DllImports.getShipCount(boardId));
 }