Class: Api::RectangleI
- Inherits:
-
Object
- Object
- Api::RectangleI
- Defined in:
- lib/sc2ai/protocol/common_pb.rb
Instance Attribute Summary collapse
-
#p0 ⇒ Object
optional field readers.
-
#p1 ⇒ Object
Returns the value of attribute p1.
Class Method Summary collapse
Instance Method Summary collapse
- #_encode(buff) ⇒ Object
- #decode_from(buff, index, len) ⇒ Object
- #has_p0? ⇒ Boolean
- #has_p1? ⇒ Boolean
-
#initialize(p0: nil, p1: nil) ⇒ RectangleI
constructor
END writers for optional fields.
- #to_h ⇒ Object
- #to_proto(_options = {}) ⇒ Object
Constructor Details
#initialize(p0: nil, p1: nil) ⇒ RectangleI
END writers for optional fields
1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 |
# File 'lib/sc2ai/protocol/common_pb.rb', line 1854 def initialize(p0: nil, p1: nil) @_bitmask = 0 if p0 == nil @p0 = nil else @_bitmask |= 0x0000000000000001 @p0 = p0 end if p1 == nil @p1 = nil else @_bitmask |= 0x0000000000000002 @p1 = p1 end end |
Instance Attribute Details
#p0 ⇒ Object
optional field readers
1837 1838 1839 |
# File 'lib/sc2ai/protocol/common_pb.rb', line 1837 def p0 @p0 end |
#p1 ⇒ Object
Returns the value of attribute p1.
1839 1840 1841 |
# File 'lib/sc2ai/protocol/common_pb.rb', line 1839 def p1 @p1 end |
Class Method Details
.decode(buff) ⇒ Object
1826 1827 1828 |
# File 'lib/sc2ai/protocol/common_pb.rb', line 1826 def self.decode(buff) allocate.decode_from(buff.b, 0, buff.bytesize) end |
.encode(obj) ⇒ Object
1830 1831 1832 |
# File 'lib/sc2ai/protocol/common_pb.rb', line 1830 def self.encode(obj) obj._encode("".b) end |
Instance Method Details
#_encode(buff) ⇒ Object
2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 |
# File 'lib/sc2ai/protocol/common_pb.rb', line 2310 def _encode(buff) val = @p0 if val buff << 0x0a # Save the buffer size before appending the submessage current_len = buff.bytesize # Write a single dummy byte to later store encoded length buff << 42 # "*" val._encode(buff) # Calculate the submessage's size = buff.bytesize - current_len - 1 # Hope the size fits in one byte byte = & 0x7F >>= 7 byte |= 0x80 if > 0 buff.setbyte(current_len, byte) # If the sub message was bigger if > 0 current_len += 1 # compute how much we need to shift encoded_int_len = 0 remaining_size = while remaining_size != 0 remaining_size >>= 7 encoded_int_len += 1 end # Make space in the string with dummy bytes buff.bytesplice(current_len, 0, "*********", 0, encoded_int_len) # Overwrite the dummy bytes with the encoded length while != 0 byte = & 0x7F >>= 7 byte |= 0x80 if > 0 buff.setbyte(current_len, byte) current_len += 1 end end buff end val = @p1 if val buff << 0x12 # Save the buffer size before appending the submessage current_len = buff.bytesize # Write a single dummy byte to later store encoded length buff << 42 # "*" val._encode(buff) # Calculate the submessage's size = buff.bytesize - current_len - 1 # Hope the size fits in one byte byte = & 0x7F >>= 7 byte |= 0x80 if > 0 buff.setbyte(current_len, byte) # If the sub message was bigger if > 0 current_len += 1 # compute how much we need to shift encoded_int_len = 0 remaining_size = while remaining_size != 0 remaining_size >>= 7 encoded_int_len += 1 end # Make space in the string with dummy bytes buff.bytesplice(current_len, 0, "*********", 0, encoded_int_len) # Overwrite the dummy bytes with the encoded length while != 0 byte = & 0x7F >>= 7 byte |= 0x80 if > 0 buff.setbyte(current_len, byte) current_len += 1 end end buff end buff end |
#decode_from(buff, index, len) ⇒ Object
1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 |
# File 'lib/sc2ai/protocol/common_pb.rb', line 1884 def decode_from(buff, index, len) @_bitmask = 0 @p0 = nil @p1 = nil return self if index >= len ## PULL_UINT64 tag = if (byte0 = buff.getbyte(index)) < 0x80 index += 1 byte0 elsif (byte1 = buff.getbyte(index + 1)) < 0x80 index += 2 (byte1 << 7) | (byte0 & 0x7F) elsif (byte2 = buff.getbyte(index + 2)) < 0x80 index += 3 (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte3 = buff.getbyte(index + 3)) < 0x80 index += 4 (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte4 = buff.getbyte(index + 4)) < 0x80 index += 5 (byte4 << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte5 = buff.getbyte(index + 5)) < 0x80 index += 6 (byte5 << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte6 = buff.getbyte(index + 6)) < 0x80 index += 7 (byte6 << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte7 = buff.getbyte(index + 7)) < 0x80 index += 8 (byte7 << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte8 = buff.getbyte(index + 8)) < 0x80 index += 9 (byte8 << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte9 = buff.getbyte(index + 9)) < 0x80 index += 10 (byte9 << 63) | ((byte8 & 0x7F) << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) else raise "integer decoding error" end ## END PULL_UINT64 found = true while true # If we have looped around since the last found tag this one is # unexpected, so discard it and continue. if !found wire_type = tag & 0x7 case wire_type when 0 i = 0 while true newbyte = buff.getbyte(index) index += 1 break if newbyte.nil? || newbyte < 0x80 i += 1 break if i > 9 end when 1 index += 8 when 2 ## PULL_BYTES value = if (byte0 = buff.getbyte(index)) < 0x80 index += 1 byte0 elsif (byte1 = buff.getbyte(index + 1)) < 0x80 index += 2 (byte1 << 7) | (byte0 & 0x7F) elsif (byte2 = buff.getbyte(index + 2)) < 0x80 index += 3 (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte3 = buff.getbyte(index + 3)) < 0x80 index += 4 (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte4 = buff.getbyte(index + 4)) < 0x80 index += 5 (byte4 << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte5 = buff.getbyte(index + 5)) < 0x80 index += 6 (byte5 << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte6 = buff.getbyte(index + 6)) < 0x80 index += 7 (byte6 << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte7 = buff.getbyte(index + 7)) < 0x80 index += 8 (byte7 << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte8 = buff.getbyte(index + 8)) < 0x80 index += 9 (byte8 << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte9 = buff.getbyte(index + 9)) < 0x80 index += 10 (byte9 << 63) | ((byte8 & 0x7F) << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) else raise "integer decoding error" end buff.byteslice(index, value) index += value ## END PULL_BYTES when 5 index += 4 else raise "unknown wire type #{wire_type}" end return self if index >= len ## PULL_UINT64 tag = if (byte0 = buff.getbyte(index)) < 0x80 index += 1 byte0 elsif (byte1 = buff.getbyte(index + 1)) < 0x80 index += 2 (byte1 << 7) | (byte0 & 0x7F) elsif (byte2 = buff.getbyte(index + 2)) < 0x80 index += 3 (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte3 = buff.getbyte(index + 3)) < 0x80 index += 4 (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte4 = buff.getbyte(index + 4)) < 0x80 index += 5 (byte4 << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte5 = buff.getbyte(index + 5)) < 0x80 index += 6 (byte5 << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte6 = buff.getbyte(index + 6)) < 0x80 index += 7 (byte6 << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte7 = buff.getbyte(index + 7)) < 0x80 index += 8 (byte7 << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte8 = buff.getbyte(index + 8)) < 0x80 index += 9 (byte8 << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte9 = buff.getbyte(index + 9)) < 0x80 index += 10 (byte9 << 63) | ((byte8 & 0x7F) << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) else raise "integer decoding error" end ## END PULL_UINT64 end found = false if tag == 0xa found = true ## PULL_MESSAGE ## PULL_UINT64 msg_len = if (byte0 = buff.getbyte(index)) < 0x80 index += 1 byte0 elsif (byte1 = buff.getbyte(index + 1)) < 0x80 index += 2 (byte1 << 7) | (byte0 & 0x7F) elsif (byte2 = buff.getbyte(index + 2)) < 0x80 index += 3 (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte3 = buff.getbyte(index + 3)) < 0x80 index += 4 (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte4 = buff.getbyte(index + 4)) < 0x80 index += 5 (byte4 << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte5 = buff.getbyte(index + 5)) < 0x80 index += 6 (byte5 << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte6 = buff.getbyte(index + 6)) < 0x80 index += 7 (byte6 << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte7 = buff.getbyte(index + 7)) < 0x80 index += 8 (byte7 << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte8 = buff.getbyte(index + 8)) < 0x80 index += 9 (byte8 << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte9 = buff.getbyte(index + 9)) < 0x80 index += 10 (byte9 << 63) | ((byte8 & 0x7F) << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) else raise "integer decoding error" end ## END PULL_UINT64 @p0 = Api::PointI.allocate.decode_from(buff, index, index += msg_len) ## END PULL_MESSAGE @_bitmask |= 0x0000000000000001 return self if index >= len ## PULL_UINT64 tag = if (byte0 = buff.getbyte(index)) < 0x80 index += 1 byte0 elsif (byte1 = buff.getbyte(index + 1)) < 0x80 index += 2 (byte1 << 7) | (byte0 & 0x7F) elsif (byte2 = buff.getbyte(index + 2)) < 0x80 index += 3 (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte3 = buff.getbyte(index + 3)) < 0x80 index += 4 (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte4 = buff.getbyte(index + 4)) < 0x80 index += 5 (byte4 << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte5 = buff.getbyte(index + 5)) < 0x80 index += 6 (byte5 << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte6 = buff.getbyte(index + 6)) < 0x80 index += 7 (byte6 << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte7 = buff.getbyte(index + 7)) < 0x80 index += 8 (byte7 << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte8 = buff.getbyte(index + 8)) < 0x80 index += 9 (byte8 << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte9 = buff.getbyte(index + 9)) < 0x80 index += 10 (byte9 << 63) | ((byte8 & 0x7F) << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) else raise "integer decoding error" end ## END PULL_UINT64 end if tag == 0x12 found = true ## PULL_MESSAGE ## PULL_UINT64 msg_len = if (byte0 = buff.getbyte(index)) < 0x80 index += 1 byte0 elsif (byte1 = buff.getbyte(index + 1)) < 0x80 index += 2 (byte1 << 7) | (byte0 & 0x7F) elsif (byte2 = buff.getbyte(index + 2)) < 0x80 index += 3 (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte3 = buff.getbyte(index + 3)) < 0x80 index += 4 (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte4 = buff.getbyte(index + 4)) < 0x80 index += 5 (byte4 << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte5 = buff.getbyte(index + 5)) < 0x80 index += 6 (byte5 << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte6 = buff.getbyte(index + 6)) < 0x80 index += 7 (byte6 << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte7 = buff.getbyte(index + 7)) < 0x80 index += 8 (byte7 << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte8 = buff.getbyte(index + 8)) < 0x80 index += 9 (byte8 << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte9 = buff.getbyte(index + 9)) < 0x80 index += 10 (byte9 << 63) | ((byte8 & 0x7F) << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) else raise "integer decoding error" end ## END PULL_UINT64 @p1 = Api::PointI.allocate.decode_from(buff, index, index += msg_len) ## END PULL_MESSAGE @_bitmask |= 0x0000000000000002 return self if index >= len ## PULL_UINT64 tag = if (byte0 = buff.getbyte(index)) < 0x80 index += 1 byte0 elsif (byte1 = buff.getbyte(index + 1)) < 0x80 index += 2 (byte1 << 7) | (byte0 & 0x7F) elsif (byte2 = buff.getbyte(index + 2)) < 0x80 index += 3 (byte2 << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte3 = buff.getbyte(index + 3)) < 0x80 index += 4 (byte3 << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte4 = buff.getbyte(index + 4)) < 0x80 index += 5 (byte4 << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte5 = buff.getbyte(index + 5)) < 0x80 index += 6 (byte5 << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte6 = buff.getbyte(index + 6)) < 0x80 index += 7 (byte6 << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte7 = buff.getbyte(index + 7)) < 0x80 index += 8 (byte7 << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte8 = buff.getbyte(index + 8)) < 0x80 index += 9 (byte8 << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) elsif (byte9 = buff.getbyte(index + 9)) < 0x80 index += 10 (byte9 << 63) | ((byte8 & 0x7F) << 56) | ((byte7 & 0x7F) << 49) | ((byte6 & 0x7F) << 42) | ((byte5 & 0x7F) << 35) | ((byte4 & 0x7F) << 28) | ((byte3 & 0x7F) << 21) | ((byte2 & 0x7F) << 14) | ((byte1 & 0x7F) << 7) | (byte0 & 0x7F) else raise "integer decoding error" end ## END PULL_UINT64 end return self if index >= len end end |
#has_p0? ⇒ Boolean
1876 1877 1878 |
# File 'lib/sc2ai/protocol/common_pb.rb', line 1876 def has_p0? (@_bitmask & 0x0000000000000001) == 0x0000000000000001 end |
#has_p1? ⇒ Boolean
1880 1881 1882 |
# File 'lib/sc2ai/protocol/common_pb.rb', line 1880 def has_p1? (@_bitmask & 0x0000000000000002) == 0x0000000000000002 end |
#to_h ⇒ Object
2410 2411 2412 2413 2414 2415 |
# File 'lib/sc2ai/protocol/common_pb.rb', line 2410 def to_h result = {} result["p0".to_sym] = @p0.to_h result["p1".to_sym] = @p1.to_h result end |
#to_proto(_options = {}) ⇒ Object
1872 1873 1874 |
# File 'lib/sc2ai/protocol/common_pb.rb', line 1872 def to_proto( = {}) self.class.encode(self) end |