blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2 values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80 values | src_encoding stringclasses 28 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 8 9.86M | extension stringclasses 52 values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
55b3aca21b6417e9747a06daf1a219a7898d276f | fc0664a076eeb69a3a8a89e7af25329c3998dd07 | /Engine/PipelineCompiler/Pipelines/ComputePipeline.cpp | cba3e561c85271913d1a578a162c25361d1009ad | [
"BSD-2-Clause"
] | permissive | azhirnov/ModularGraphicsFramework | fabece2887da16c8438748c9dd5f3091a180058d | 348be601f1991f102defa0c99250529f5e44c4d3 | refs/heads/master | 2021-07-14T06:31:31.127788 | 2018-11-19T14:28:16 | 2018-11-19T14:28:16 | 88,896,906 | 14 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,262 | cpp | // Copyright (c) Zhirnov Andrey. For more information see 'LICENSE.txt'
#include "Engine/PipelineCompiler/Pipelines/ComputePipeline.h"
#include "Core/STL/Algorithms/StringParser.h"
namespace PipelineCompiler
{
/*
=================================================
constructor
=================================================
*/
ComputePipeline::ComputePipeline (StringCRef name) : BasePipeline(name)
{
}
/*
=================================================
Prepare
----
pass 1
=================================================
*/
bool ComputePipeline::Prepare (const ConverterConfig &cfg)
{
ShaderDisasembly disasm;
CHECK_ERR( _DisasembleShader( cfg, INOUT shader, OUT disasm ) );
// unite struct and block types from shaders
_structTypes.Clear();
CHECK_ERR( _MergeStructTypes( disasm.structTypes, INOUT _structTypes ) );
// update offsets by packing
CHECK_ERR( _CalculateOffsets( INOUT _structTypes ) );
_originTypes = _structTypes;
CHECK_ERR( _UpdateBindings() );
CHECK_ERR( _UpdateDescriptorSets() );
_lastEditTime = Max( _lastEditTime, shader.LastEditTime() );
return true;
}
/*
=================================================
Convert
----
pass 2
=================================================
*/
bool ComputePipeline::Convert (OUT String &src, Ptr<ISerializer> ser, const ConverterConfig &constCfg) const
{
ConverterConfig cfg = constCfg;
src.Clear();
src << ser->Comment( "This is generated file" );
src << ser->Comment( "Origin file: '"_str << Path() << "'" );
//src << ser->Comment( "Created at: "_str << ToString( Date().Now() ) ) << '\n';
src << ser->BeginFile( false );
// add c++ types localy
if ( not cfg.searchForSharedTypes )
{
/*cfg._glslTypes = "";
CHECK_ERR( _CalculateOffsets( INOUT _structTypes ) );
if ( cfg.addPaddingToStructs )
{
CHECK_ERR( _AddPaddingToStructs( INOUT _structTypes ) );
CHECK_ERR( _CalculateOffsets( INOUT _structTypes ) );
}
String ser_str;
CHECK_ERR( _AllStructsToString( _structTypes, ser, OUT ser_str, OUT cfg._glslTypes ) );
src << ser_str;*/
}
FOR( i, cfg.includings ) {
src << ser->Include( cfg.includings[i] );
}
// mark place for c++ source
if ( constCfg.targets.IsExist( EShaderFormat::Soft_100_Exe ) )
{
src << ser->Comment( "C++ shader" );
}
src << '\n' << ser->BeginNamespace( cfg.nameSpace ) << '\n';
// serialize descriptor
src << ser->DeclFunction( "void", "Create_"_str << Name(), {{"PipelineTemplateDescription&", "descr"}} );
src << ser->BeginScope();
src << ser->AssignVariable( "\tdescr", "PipelineTemplateDescription()" );
src << ser->ToString( "\tdescr.supportedShaders", EShader::bits() | EShader::Compute ) << '\n';
src << ser->ToString( "\tdescr.localGroupSize", localGroupSize );
CHECK_ERR( _ConvertLayout( "\tdescr.layout", INOUT src, ser ) );
CHECK_ERR( _ConvertComputeShader( INOUT src, ser, cfg ) );
src << ser->EndScope(); // function
src << ser->EndNamespace();
src << ser->EndFile( false );
return true;
}
/*
=================================================
_ConvertComputeShader
----
pass 2
=================================================
*/
bool ComputePipeline::_ConvertComputeShader (INOUT String &src, Ptr<ISerializer> ser, const ConverterConfig &cfg) const
{
CHECK_ERR( shader.IsEnabled() );
CompiledShader_t compiled;
CHECK_ERR( _CompileShader( shader, cfg, OUT compiled ) );
const String name = "\t" + ser->CallFunction( "descr.Compute", Uninitialized );
for (auto& comp : compiled)
{
if ( comp.first != EShaderFormat::Soft_100_Exe )
src << ser->ShaderToString( comp.first, name, comp.second );
}
if ( cfg.targets.IsExist( EShaderFormat::Soft_100_Exe ) )
{
usize pos;
if ( src.Find( "C++ shader", OUT pos ) )
{
StringParser::ToNextLine( src, INOUT pos );
const String func_name = "sw_"_str << Name() << "_comp";
src.Insert( ser->ShaderSrcCPP_Impl( name, compiled( EShaderFormat::Soft_100_Exe ), func_name ), pos );
src << ser->ShaderSrcCPP( name, func_name );
}
}
src << '\n';
if ( cfg.validation ) {
CHECK_ERR( _ValidateShader( EShader::Compute, compiled ) );
}
return true;
}
} // PipelineCompiler
| [
"zh1dron@gmail.com"
] | zh1dron@gmail.com |
c486a0bc05aafd746fed8d46e20bcd96c2b4fb8e | 238e46a903cf7fac4f83fa8681094bf3c417d22d | /OCC/opencascade-7.2.0/x64/debug/inc/BVH_Types.hxx | 70dc9bfafdda3662f52623200d4543cab5ec85c3 | [
"BSD-3-Clause"
] | permissive | baojunli/FastCAE | da1277f90e584084d461590a3699b941d8c4030b | a3f99f6402da564df87fcef30674ce5f44379962 | refs/heads/master | 2023-02-25T20:25:31.815729 | 2021-02-01T03:17:33 | 2021-02-01T03:17:33 | 268,390,180 | 1 | 0 | BSD-3-Clause | 2020-06-01T00:39:31 | 2020-06-01T00:39:31 | null | UTF-8 | C++ | false | false | 8,249 | hxx | // Created on: 2013-12-20
// Created by: Denis BOGOLEPOV
// Copyright (c) 2013-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _BVH_Types_Header
#define _BVH_Types_Header
// Use this macro to switch between STL and OCCT vector types
#define _BVH_USE_STD_VECTOR_
#include <vector>
#include <NCollection_Mat4.hxx>
#include <NCollection_Vec2.hxx>
#include <NCollection_Vec3.hxx>
#include <NCollection_Vector.hxx>
#include <Standard_Type.hxx>
// GCC supports shrink function only in C++11 mode
#if defined(_BVH_USE_STD_VECTOR_) && defined(_MSC_VER) && !defined(__INTEL_COMPILER)
#define _STD_VECTOR_SHRINK
#endif
namespace BVH
{
//! Tool class for selecting appropriate vector type (Eigen or NCollection).
//! \tparam T Numeric data type
//! \tparam N Component number
template<class T, int N> struct VectorType
{
// Not implemented
};
template<class T> struct VectorType<T, 1>
{
typedef T Type;
};
template<class T> struct VectorType<T, 2>
{
typedef NCollection_Vec2<T> Type;
};
template<class T> struct VectorType<T, 3>
{
typedef NCollection_Vec3<T> Type;
};
template<class T> struct VectorType<T, 4>
{
typedef NCollection_Vec4<T> Type;
};
//! Tool class for selecting appropriate matrix type (Eigen or NCollection).
//! \tparam T Numeric data type
//! \tparam N Matrix dimension
template<class T, int N> struct MatrixType
{
// Not implemented
};
template<class T> struct MatrixType<T, 4>
{
typedef NCollection_Mat4<T> Type;
};
//! Tool class for selecting type of array of vectors (STD or NCollection vector).
//! \tparam T Numeric data type
//! \tparam N Component number
template<class T, int N = 1> struct ArrayType
{
#ifndef _BVH_USE_STD_VECTOR_
typedef NCollection_Vector<typename VectorType<T, N>::Type> Type;
#else
typedef std::vector<typename VectorType<T, N>::Type> Type;
#endif
};
}
//! 2D vector of integers.
typedef BVH::VectorType<Standard_Integer, 2>::Type BVH_Vec2i;
//! 3D vector of integers.
typedef BVH::VectorType<Standard_Integer, 3>::Type BVH_Vec3i;
//! 4D vector of integers.
typedef BVH::VectorType<Standard_Integer, 4>::Type BVH_Vec4i;
//! Array of 2D vectors of integers.
typedef BVH::ArrayType<Standard_Integer, 2>::Type BVH_Array2i;
//! Array of 3D vectors of integers.
typedef BVH::ArrayType<Standard_Integer, 3>::Type BVH_Array3i;
//! Array of 4D vectors of integers.
typedef BVH::ArrayType<Standard_Integer, 4>::Type BVH_Array4i;
//! 2D vector of single precision reals.
typedef BVH::VectorType<Standard_ShortReal, 2>::Type BVH_Vec2f;
//! 3D vector of single precision reals.
typedef BVH::VectorType<Standard_ShortReal, 3>::Type BVH_Vec3f;
//! 4D vector of single precision reals.
typedef BVH::VectorType<Standard_ShortReal, 4>::Type BVH_Vec4f;
//! Array of 2D vectors of single precision reals.
typedef BVH::ArrayType<Standard_ShortReal, 2>::Type BVH_Array2f;
//! Array of 3D vectors of single precision reals.
typedef BVH::ArrayType<Standard_ShortReal, 3>::Type BVH_Array3f;
//! Array of 4D vectors of single precision reals.
typedef BVH::ArrayType<Standard_ShortReal, 4>::Type BVH_Array4f;
//! 2D vector of double precision reals.
typedef BVH::VectorType<Standard_Real, 2>::Type BVH_Vec2d;
//! 3D vector of double precision reals.
typedef BVH::VectorType<Standard_Real, 3>::Type BVH_Vec3d;
//! 4D vector of double precision reals.
typedef BVH::VectorType<Standard_Real, 4>::Type BVH_Vec4d;
//! Array of 2D vectors of double precision reals.
typedef BVH::ArrayType<Standard_Real, 2>::Type BVH_Array2d;
//! Array of 3D vectors of double precision reals.
typedef BVH::ArrayType<Standard_Real, 3>::Type BVH_Array3d;
//! Array of 4D vectors of double precision reals.
typedef BVH::ArrayType<Standard_Real, 4>::Type BVH_Array4d;
//! 4x4 matrix of single precision reals.
typedef BVH::MatrixType<Standard_ShortReal, 4>::Type BVH_Mat4f;
//! 4x4 matrix of double precision reals.
typedef BVH::MatrixType<Standard_Real, 4>::Type BVH_Mat4d;
namespace BVH
{
//! Tool class for accessing specific vector component (by index).
//! \tparam T Numeric data type
//! \tparam N Component number
template<class T, int N> struct VecComp
{
// Not implemented
};
template<class T> struct VecComp<T, 2>
{
typedef typename BVH::VectorType<T, 2>::Type BVH_Vec2t;
static T Get (const BVH_Vec2t& theVec, const Standard_Integer theAxis)
{
return theAxis == 0 ? theVec.x() : theVec.y();
}
};
template<class T> struct VecComp<T, 3>
{
typedef typename BVH::VectorType<T, 3>::Type BVH_Vec3t;
static T Get (const BVH_Vec3t& theVec, const Standard_Integer theAxis)
{
return theAxis == 0 ? theVec.x() : ( theAxis == 1 ? theVec.y() : theVec.z() );
}
};
template<class T> struct VecComp<T, 4>
{
typedef typename BVH::VectorType<T, 4>::Type BVH_Vec4t;
static T Get (const BVH_Vec4t& theVec, const Standard_Integer theAxis)
{
return theAxis == 0 ? theVec.x() :
(theAxis == 1 ? theVec.y() : ( theAxis == 2 ? theVec.z() : theVec.w() ));
}
};
//! Tool class providing typical operations on the array. It allows
//! for interoperability between STD vector and NCollection vector.
//! \tparam T Numeric data type
//! \tparam N Component number
template<class T, int N = 1> struct Array
{
typedef typename BVH::ArrayType<T, N>::Type BVH_ArrayNt;
//! Returns a const reference to the element with the given index.
static inline const typename BVH::VectorType<T, N>::Type& Value (
const BVH_ArrayNt& theArray, const Standard_Integer theIndex)
{
#ifdef _BVH_USE_STD_VECTOR_
return theArray[theIndex];
#else
return theArray.Value (theIndex);
#endif
}
//! Returns a reference to the element with the given index.
static inline typename BVH::VectorType<T, N>::Type& ChangeValue (
BVH_ArrayNt& theArray, const Standard_Integer theIndex)
{
#ifdef _BVH_USE_STD_VECTOR_
return theArray[theIndex];
#else
return theArray.ChangeValue (theIndex);
#endif
}
//! Adds the new element at the end of the array.
static inline void Append (BVH_ArrayNt& theArray,
const typename BVH::VectorType<T, N>::Type& theElement)
{
#ifdef _BVH_USE_STD_VECTOR_
theArray.push_back (theElement);
#else
theArray.Append (theElement);
#endif
}
//! Returns the number of elements in the given array.
static inline Standard_Integer Size (const BVH_ArrayNt& theArray)
{
#ifdef _BVH_USE_STD_VECTOR_
return static_cast<Standard_Integer> (theArray.size());
#else
return static_cast<Standard_Integer> (theArray.Size());
#endif
}
//! Removes all elements from the given array.
static inline void Clear (BVH_ArrayNt& theArray)
{
#ifdef _BVH_USE_STD_VECTOR_
theArray.clear();
#else
theArray.Clear();
#endif
}
//! Requests that the array capacity be at least enough to
//! contain given number of elements. This function has no
//! effect in case of NCollection based array.
static inline void Reserve (BVH_ArrayNt& theArray, const Standard_Integer theCount)
{
#ifdef _BVH_USE_STD_VECTOR_
if (Size (theArray) == theCount)
{
#ifdef _STD_VECTOR_SHRINK
theArray.shrink_to_fit();
#endif
}
else
{
theArray.reserve (theCount);
}
#else
// do nothing
#endif
}
};
template<class T>
static inline Standard_Integer IntFloor (const T theValue)
{
const Standard_Integer aRes = static_cast<Standard_Integer> (theValue);
return aRes - static_cast<Standard_Integer> (aRes > theValue);
}
}
#endif // _BVH_Types_Header
| [
"l”ibaojunqd@foxmail.com“"
] | l”ibaojunqd@foxmail.com“ |
7fc77e08abeb6357ab81aaeede036c11a7352e94 | 81a38d6e70bcd2daca4f7a29507da67b4053fe34 | /jersh/PresqueMobiusEngine/PresqueMobiusEngine/Tetrimino.cpp | a4763d520b44000fd579d8211763242ba07278a1 | [] | no_license | THEGRANDEMPEROR/giant-rom-2-game-jam | d9d50390d70a407a1a2dd537ee8fdc46aeb11fc5 | 252e3da12cfa7dd37289269be13e79def437460d | refs/heads/master | 2021-01-10T15:04:32.370590 | 2015-12-07T06:17:54 | 2015-12-07T06:17:54 | 47,146,222 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,533 | cpp | #pragma once
#include "Tetrimino.h"
#include "Engine.h"
Block::Block() {
magic = false;
position.x = 0;
position.y = 0.0f;
}
Block::~Block() {
}
void Block::Init(fallingpos a_pos, bool a_magic) {
position.x = a_pos.x;
position.y = a_pos.y;
magic = a_magic;
}
fallingpos Block::getPos() {
return position;
}
bool Block::getMagic() {
return magic;
}
void Block::setPos(fallingpos a_pos) {
position.x = a_pos.x;
position.y = a_pos.y;
}
void Block::Move(int a_x, float a_y) {
position.x += a_x;
position.y += a_y;
}
void Block::Move(int a_x, int a_y) {
position.x += a_x;
position.y += a_y;
}
void Block::setMagic(bool a_magic) {
magic = a_magic;
}
Tetrimino::Tetrimino() {
Init(LINE, false);
}
Tetrimino::~Tetrimino() {
}
Tetrimino::Tetrimino(const Tetrimino &a_tet) {
for (int i = 0; i < TETRIMINO_SIZE; ++i) {
blocks[i] = a_tet.blocks[i];
}
type = a_tet.type;
}
void Tetrimino::Init(TetriminoType a_type, bool a_magic) {
type = a_type;
if (a_type == LINE) {
blocks[0].Init(fallingpos(3, 1.0f), false);
blocks[1].Init(fallingpos(4, 1.0f), false);
blocks[2].Init(fallingpos(5, 1.0f), false);
blocks[3].Init(fallingpos(6, 1.0f), false);
}
else if (a_type == SQUARE) {
blocks[0].Init(fallingpos(4, 0.0f), false);
blocks[1].Init(fallingpos(5, 0.0f), false);
blocks[2].Init(fallingpos(5, 1.0f), false);
blocks[3].Init(fallingpos(4, 1.0f), false);
}
else if (a_type == LPIECE) {
blocks[0].Init(fallingpos(3, 1.0f), false);
blocks[1].Init(fallingpos(4, 1.0f), false);
blocks[2].Init(fallingpos(5, 1.0f), false);
blocks[3].Init(fallingpos(5, 0.0f), false);
}
else if (a_type == JPIECE) {
blocks[0].Init(fallingpos(3, 0.0f), false);
blocks[1].Init(fallingpos(4, 0.0f), false);
blocks[2].Init(fallingpos(5, 0.0f), false);
blocks[3].Init(fallingpos(5, 1.0f), false);
}
else if (a_type == SPIECE) {
blocks[0].Init(fallingpos(5, 0.0f), false);
blocks[1].Init(fallingpos(4, 0.0f), false);
blocks[2].Init(fallingpos(4, 1.0f), false);
blocks[3].Init(fallingpos(3, 1.0f), false);
}
else if (a_type == ZPIECE) {
blocks[0].Init(fallingpos(3, 0.0f), false);
blocks[1].Init(fallingpos(4, 0.0f), false);
blocks[2].Init(fallingpos(4, 1.0f), false);
blocks[3].Init(fallingpos(5, 1.0f), false);
}
else if (a_type == TPIECE) {
blocks[0].Init(fallingpos(3, 1.0f), false);
blocks[1].Init(fallingpos(4, 1.0f), false);
blocks[2].Init(fallingpos(5, 1.0f), false);
blocks[3].Init(fallingpos(4, 0.0f), false);
}
if (a_magic)
blocks[1].setMagic(a_magic);
}
void Tetrimino::Move(int a_x, float a_y) {
for (int i = 0; i < TETRIMINO_SIZE; ++i) {
blocks[i].Move(a_x, a_y);
}
}
void Tetrimino::Move(int a_x, int a_y) {
for (int i = 0; i < TETRIMINO_SIZE; ++i) {
blocks[i].Move(a_x, a_y);
}
}
Block Tetrimino::getBlock(int a_index) {
return blocks[a_index];
}
TetriminoType Tetrimino::getType() {
return type;
}
void Tetrimino::Snap(bool a_snap) {
float temp;
for (int i = 0; i < TETRIMINO_SIZE; ++i) {
if (a_snap)
temp = ceilf(blocks[i].getPos().y) - blocks[i].getPos().y;
else
temp = floorf(blocks[i].getPos().y) - blocks[i].getPos().y;
blocks[i].Move(0, temp);
}
}
void Tetrimino::SetBlockPos(int a_index, fallingpos a_pos) {
blocks[a_index].setPos(a_pos);
}
Tetrimino& Tetrimino::operator=(Tetrimino& a_tet) {
for (int i = 0; i < TETRIMINO_SIZE; ++i) {
blocks[i].setMagic(a_tet.getBlock(i).getMagic());
blocks[i].setPos(a_tet.getBlock(i).getPos());
}
type = a_tet.getType();
return *this;
}
| [
"thatjoshfoleydude@gmail.com"
] | thatjoshfoleydude@gmail.com |
dbf19455ca02e07e3a134fde8704165b768675eb | ae257eda1dba7c93d0ee350ea41232e9bb8d109c | /Problem325/Source.cpp | f0d278bc449decac52afdf23214978585f6802be | [] | no_license | rutkowskit/DCP | e3073b3bb9aa39758a462fa0be43c6ce0b964aaf | 0abe815b9a73b25a3c68d3a8a1bf87337f610da9 | refs/heads/master | 2021-06-20T19:13:12.699135 | 2021-01-23T11:27:49 | 2021-01-23T11:27:49 | 172,335,093 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,329 | cpp | // This problem was asked by Jane Street.
//
// The United States uses the imperial system of weightsand measures, which means that there are many different, seemingly arbitrary units to measure distance.
// There are 12 inches in a foot, 3 feet in a yard, 22 yards in a chain, and so on.
//
// Create a data structure that can efficiently convert a certain quantity of one unit to the correct amount of any other unit.
// You should also allow for additional units to be added to the system.
#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
enum class Units
{
Inch=1,
Centimeter=2,
Foot=3,
Yard=4,
Chain=5
};
// extendible factors map - can be stored in db, file etc.
std::map<Units, float> UnitToInchFactors =
{
{Units::Inch, 1.00f},
{Units::Centimeter, 1.00 / 2.54}, //cm for fun :)
{Units::Foot, 12.00f}, //12 inches in a foot
{Units::Yard, 3.00 * 12.00f}, //3 feet in a yard
{Units::Chain, 22.00 * 3.00 * 12.00f}, //22 yards in a chain
};
class Solution
{
private:
public:
float Solve(float number, Units sourceUnit, Units destinationUnit)
{
return number * UnitToInchFactors[sourceUnit]/UnitToInchFactors[destinationUnit];
}
};
int main()
{
Solution solution;
auto result = solution.Solve(12, Units::Inch, Units::Foot);
return 0;
}
| [
"rutkowskit@gmail.com"
] | rutkowskit@gmail.com |
6ee18c06ab47fea664fa235bf905de0bdd5e619e | 301ba7367a93275b8c11d0fe77fd6e1aa00870ac | /src/utils/WindowDefinition.h | b28088166285d69d8c4026b39570e4ae716f2e14 | [
"Apache-2.0"
] | permissive | LiamPilot/LightSaber | 6900489b2d2c6d555f33ecbf523d580bee90954e | 1215097428d9e2122c0b263cd2a9a7224dac5f13 | refs/heads/master | 2022-10-01T02:21:27.149957 | 2020-06-02T21:12:56 | 2020-06-02T21:12:56 | 268,609,589 | 0 | 0 | Apache-2.0 | 2020-06-01T19:10:44 | 2020-06-01T19:10:43 | null | UTF-8 | C++ | false | false | 2,088 | h | #pragma once
#include <string>
#include <stdexcept>
/*
* \brief The class used to defined different window types.
*
* At the moment only tumbling and sliding windows are supported.
*
* */
enum WindowMeasure { ROW_BASED, RANGE_BASED };
enum WindowType { TUMBLING, SLIDING, SESSION };
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-function"
static WindowMeasure fromString(std::string &measure) {
if (measure == "row")
return ROW_BASED;
else if (measure == "range")
return RANGE_BASED;
else
throw std::invalid_argument("error: unknown window type " + measure);
}
#pragma clang diagnostic pop
class WindowDefinition {
private:
long m_size;
long m_slide;
long m_paneSize;
long m_gap;
WindowMeasure m_windowMeasure;
WindowType m_type;
long gcd(long a, long b) {
if (b == 0)
return a;
return
gcd(b, a % b);
}
public:
WindowDefinition(WindowMeasure measure, long size, long slide)
: m_size(size), m_slide(slide), m_gap(0), m_windowMeasure(measure) {
m_paneSize = gcd(m_size, m_slide);
if (slide < size)
m_type = SLIDING;
else if (slide == size)
m_type = TUMBLING;
else
throw std::runtime_error("error: wrong input parameters for window definition");
}
WindowDefinition(WindowMeasure measure, long gap)
: m_size(0), m_slide(0), m_paneSize(0), m_gap(gap), m_windowMeasure(measure) {
m_type = SESSION;
}
long getSize() {
return m_size;
}
long getSlide() {
return m_slide;
}
long getGap() {
return m_gap;
}
WindowMeasure getWindowMeasure() {
return m_windowMeasure;
}
WindowType getWindowType() {
return m_type;
}
long getPaneSize() {
return m_paneSize;
}
long numberOfPanes() {
return (m_size / m_paneSize);
}
long panesPerSlide() {
return (m_slide / m_paneSize);
}
bool isRowBased() {
return (m_windowMeasure == ROW_BASED);
}
bool isRangeBased() {
return (m_windowMeasure == RANGE_BASED);
}
bool isTumbling() {
return (m_size == m_slide);
}
}; | [
"giwrgosrtheod@gmail.com"
] | giwrgosrtheod@gmail.com |
1903dc504c32e481384ffa90ea88e44b015740ff | 5fc9a3f32816fc18eb87ff14fffc2df1d0f40f78 | /libs/fbjni/src/main/cpp/include/fb/lyra.h | 6b8bdf346fa18906b8e59ec4cc4d353d7d940730 | [
"MIT"
] | permissive | elboman/Sonar | dfdd07cd1976503a6e959a813713ffc6e60d97ac | 992c032fe77ee6a7bad16fd273c7b52e5472ac7d | refs/heads/master | 2020-03-21T11:08:02.023560 | 2018-06-21T20:08:47 | 2018-06-21T20:18:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,611 | h | /*
* Copyright (c) 2004-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#pragma once
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#include <fb/visibility.h>
namespace facebook {
namespace lyra {
constexpr size_t kDefaultLimit = 64;
using InstructionPointer = const void*;
class FBEXPORT StackTraceElement {
public:
StackTraceElement(InstructionPointer absoluteProgramCounter,
InstructionPointer libraryBase,
InstructionPointer functionAddress, std::string libraryName,
std::string functionName)
: absoluteProgramCounter_{absoluteProgramCounter},
libraryBase_{libraryBase},
functionAddress_{functionAddress},
libraryName_{std::move(libraryName)},
functionName_{std::move(functionName)} {}
InstructionPointer libraryBase() const noexcept { return libraryBase_; }
InstructionPointer functionAddress() const noexcept {
return functionAddress_;
}
InstructionPointer absoluteProgramCounter() const noexcept {
return absoluteProgramCounter_;
}
const std::string& libraryName() const noexcept { return libraryName_; }
const std::string& functionName() const noexcept { return functionName_; }
/**
* The offset of the program counter to the base of the library (i.e. the
* address that addr2line takes as input>
*/
std::ptrdiff_t libraryOffset() const noexcept {
auto absoluteLibrary = static_cast<const char*>(libraryBase_);
auto absoluteabsoluteProgramCounter =
static_cast<const char*>(absoluteProgramCounter_);
return absoluteabsoluteProgramCounter - absoluteLibrary;
}
/**
* The offset within the current function
*/
int functionOffset() const noexcept {
auto absoluteSymbol = static_cast<const char*>(functionAddress_);
auto absoluteabsoluteProgramCounter =
static_cast<const char*>(absoluteProgramCounter_);
return absoluteabsoluteProgramCounter - absoluteSymbol;
}
private:
const InstructionPointer absoluteProgramCounter_;
const InstructionPointer libraryBase_;
const InstructionPointer functionAddress_;
const std::string libraryName_;
const std::string functionName_;
};
/**
* Populate the vector with the current stack trace
*
* Note that this trace needs to be symbolicated to get the library offset even
* if it is to be symbolicated off-line.
*
* Beware of a bug on some platforms, which makes the trace loop until the
* buffer is full when it reaches a noexpr function. It seems to be fixed in
* newer versions of gcc. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56846
*
* @param stackTrace The vector that will receive the stack trace. Before
* filling the vector it will be cleared. The vector will never grow so the
* number of frames captured is limited by the capacity of it.
*
* @param skip The number of frames to skip before capturing the trace
*/
FBEXPORT void getStackTrace(std::vector<InstructionPointer>& stackTrace,
size_t skip = 0);
/**
* Creates a vector and populates it with the current stack trace
*
* Note that this trace needs to be symbolicated to get the library offset even
* if it is to be symbolicated off-line.
*
* Beware of a bug on some platforms, which makes the trace loop until the
* buffer is full when it reaches a noexpr function. It seems to be fixed in
* newer versions of gcc. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56846
*
* @param skip The number of frames to skip before capturing the trace
*
* @limit The maximum number of frames captured
*/
FBEXPORT inline std::vector<InstructionPointer> getStackTrace(
size_t skip = 0,
size_t limit = kDefaultLimit) {
auto stackTrace = std::vector<InstructionPointer>{};
stackTrace.reserve(limit);
getStackTrace(stackTrace, skip + 1);
return stackTrace;
}
/**
* Symbolicates a stack trace into a given vector
*
* @param symbols The vector to receive the output. The vector is cleared and
* enough room to keep the frames are reserved.
*
* @param stackTrace The input stack trace
*/
FBEXPORT void getStackTraceSymbols(std::vector<StackTraceElement>& symbols,
const std::vector<InstructionPointer>& trace);
/**
* Symbolicates a stack trace into a new vector
*
* @param stackTrace The input stack trace
*/
FBEXPORT inline std::vector<StackTraceElement> getStackTraceSymbols(
const std::vector<InstructionPointer>& trace) {
auto symbols = std::vector<StackTraceElement>{};
getStackTraceSymbols(symbols, trace);
return symbols;
}
/**
* Captures and symbolicates a stack trace
*
* Beware of a bug on some platforms, which makes the trace loop until the
* buffer is full when it reaches a noexpr function. It seems to be fixed in
* newer versions of gcc. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56846
*
* @param skip The number of frames before capturing the trace
*
* @param limit The maximum number of frames captured
*/
FBEXPORT inline std::vector<StackTraceElement> getStackTraceSymbols(
size_t skip = 0,
size_t limit = kDefaultLimit) {
return getStackTraceSymbols(getStackTrace(skip + 1, limit));
}
/**
* Formatting a stack trace element
*/
FBEXPORT std::ostream& operator<<(std::ostream& out, const StackTraceElement& elm);
/**
* Formatting a stack trace
*/
FBEXPORT std::ostream& operator<<(std::ostream& out,
const std::vector<StackTraceElement>& trace);
}
}
| [
"danielbuechele@devvm391.lla2.facebook.com"
] | danielbuechele@devvm391.lla2.facebook.com |
d42820e0a6da93d95798c51a3c336f0c48571a2b | cd50eac7166505a8d2a9ef35a1e2992072abac92 | /templates/data-structures/fenwick-2d.h | ad91b7a06a8b9fbd4d4095d259f7f33478dc7c0a | [] | no_license | AvaLovelace1/competitive-programming | 8cc8e6c8de13cfdfca9a63e125e648ec60d1e0f7 | a0e37442fb7e9bf1dba4b87210f02ef8a134e463 | refs/heads/master | 2022-06-17T04:01:08.461081 | 2022-04-28T00:08:16 | 2022-04-28T00:08:16 | 123,814,632 | 8 | 5 | null | null | null | null | UTF-8 | C++ | false | false | 1,041 | h | template<typename T, int MAX_N, int MAX_M> struct Fenwick2D {
int N, M;
T arr[MAX_N + 2][MAX_M + 2], tree[MAX_N + 2][MAX_M + 2];
Fenwick2D(int N, int M): N{N}, M{M}, arr{}, tree{} {}
Fenwick2D(int N, int M, T a[][MAX_M]): N{N}, M{M}, arr{}, tree{} {
for (int i = 1; i <= N; ++i) {
for (int j = 1; j <= M; ++j) {
upd(i, j, a[i][j]);
}
}
}
void upd(int r, int c, T x) {
T add = x - arr[r][c];
arr[r][c] = x;
for (int i = r; i <= N; i += i & -i) {
for (int j = c; j <= M; j += j & -j) {
tree[i][j] += add;
}
}
}
T quer(int r, int c) {
T sum = 0;
for (int i = r; i > 0; i -= i & -i) {
for (int j = c; j > 0; j -= j & -j) {
sum += tree[i][j];
}
}
return sum;
}
T quer(int r1, int c1, int r2, int c2) {
return quer(r2, c2) - quer(r1 - 1, c2) - quer(r2, c1 - 1) + quer(r1 - 1, c1 - 1);
}
};
| [
"flatthefish@gmail.com"
] | flatthefish@gmail.com |
a02c2e4aeccaf70132b8a06cc2965960d7e7a6e9 | f4dc7e02e4ff861aaeee64918c52ca2f2a34545e | /dynamic_domain/system/decomposeParDict | d2a7fe7ff51f59e2dceee6ac615f113bcce65f4e | [] | no_license | efirvida/OpenFoam-Wind-Simulation | c60f4b1b5a1de4759144748b25eb4624baef67ac | ab50da3e19175a7fa109ae275fd803df0fb5edd7 | refs/heads/master | 2020-07-21T07:54:26.283582 | 2016-11-17T18:25:57 | 2016-11-17T18:25:57 | 73,850,890 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,001 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 4.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
method hierarchical;
hierarchicalCoeffs
{
n (4 1 1);
delta 0.001;
order xyz;
}
// ************************************************************************* //
| [
"Eduardo M. Firvida"
] | Eduardo M. Firvida | |
066d6b0d521a7200ef65093c38adf123b2ae4e7e | fe47c3f677707543adf49ff6356949071c7be930 | /ircd/m/v1.cc | be970b16b642e136478d946a4e41391765b2844b | [
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | MortenPW/charybdis | 5aa292cabe757e1f064914ff4b192f6312b381cd | e517839d48a33274b1cf2cd704e216af8fa89022 | refs/heads/master | 2020-03-18T01:26:12.103078 | 2018-05-20T07:42:38 | 2018-05-20T07:42:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 30,214 | cc | // Matrix Construct
//
// Copyright (C) Matrix Construct Developers, Authors & Contributors
// Copyright (C) 2016-2018 Jason Volk <jason@zemos.net>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice is present in all copies. The
// full license for this software is available in the LICENSE file.
///////////////////////////////////////////////////////////////////////////////
//
// v1/groups.h
//
ircd::m::v1::groups::publicised::publicised(const id::node &node,
const vector_view<const id::user> &user_ids,
const mutable_buffer &buf_,
opts opts)
:server::request{[&]
{
if(!opts.remote)
opts.remote = node.host();
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = node.host();
if(!defined(json::get<"uri"_>(opts.request)))
json::get<"uri"_>(opts.request) = "/_matrix/federation/v1/get_groups_publicised";
json::get<"method"_>(opts.request) = "POST";
mutable_buffer buf{buf_};
const string_view user_ids_
{
json::stringify(buf, user_ids.data(), user_ids.data() + user_ids.size())
};
assert(!defined(json::get<"content"_>(opts.request)));
json::get<"content"_>(opts.request) = stringify(buf, json::members
{
{ "user_ids", user_ids_ }
});
// (front of buf was advanced by stringify)
opts.out.content = json::get<"content"_>(opts.request);
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
consume(buf, size(opts.out.head));
opts.in.head = buf;
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/send.h
//
void
ircd::m::v1::send::response::for_each_pdu(const pdus_closure &closure)
const
{
const json::object &pdus
{
this->get("pdus")
};
for(const auto &member : pdus)
{
const id::event &event_id{member.first};
const json::object &error{member.second};
closure(event_id, error);
}
}
ircd::m::v1::send::send(const string_view &txnid,
const const_buffer &content,
const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
assert(!!opts.remote);
assert(!size(opts.out.content));
opts.out.content = content;
assert(!defined(json::get<"content"_>(opts.request)));
json::get<"content"_>(opts.request) = json::object{opts.out.content};
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(!defined(json::get<"uri"_>(opts.request)))
{
thread_local char urlbuf[1024], txnidbuf[512];
json::get<"uri"_>(opts.request) = fmt::sprintf
{
urlbuf, "/_matrix/federation/v1/send/%s/",
url::encode(txnid, txnidbuf),
};
}
json::get<"method"_>(opts.request) = "PUT";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/public_rooms.h
//
ircd::m::v1::public_rooms::public_rooms(const net::hostport &remote,
const mutable_buffer &buf)
:public_rooms
{
remote, buf, opts{}
}
{
}
ircd::m::v1::public_rooms::public_rooms(const net::hostport &remote,
const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
if(!opts.remote)
opts.remote = remote;
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(defined(json::get<"content"_>(opts.request)))
opts.out.content = json::get<"content"_>(opts.request);
if(!defined(json::get<"content"_>(opts.request)))
json::get<"content"_>(opts.request) = json::object{opts.out.content};
if(!defined(json::get<"uri"_>(opts.request)))
{
thread_local char urlbuf[3072], query[2048], since[1024], tpid[1024];
std::stringstream qss;
pubsetbuf(qss, query);
if(opts.since)
qss << "&since="
<< url::encode(opts.since, since);
if(opts.third_party_instance_id)
qss << "&third_party_instance_id="
<< url::encode(opts.third_party_instance_id, tpid);
json::get<"uri"_>(opts.request) = fmt::sprintf
{
urlbuf, "/_matrix/federation/v1/publicRooms?limit=%zu%s%s",
opts.limit,
opts.include_all_networks? "&include_all_networks=true" : "",
view(qss, query)
};
}
json::get<"method"_>(opts.request) = "GET";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/backfill.h
//
ircd::m::v1::backfill::backfill(const room::id &room_id,
const mutable_buffer &buf)
:backfill
{
room_id, buf, opts{}
}
{
}
ircd::m::v1::backfill::backfill(const room::id &room_id,
const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
if(!opts.remote)
opts.remote = room_id.host();
m::event::id::buf event_id_buf;
if(!opts.event_id)
{
event_id_buf = fetch_head(room_id, opts.remote);
opts.event_id = event_id_buf;
}
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(defined(json::get<"content"_>(opts.request)))
opts.out.content = json::get<"content"_>(opts.request);
if(!defined(json::get<"content"_>(opts.request)))
json::get<"content"_>(opts.request) = json::object{opts.out.content};
if(!defined(json::get<"uri"_>(opts.request)))
{
thread_local char urlbuf[2048], ridbuf[768], eidbuf[768];
json::get<"uri"_>(opts.request) = fmt::sprintf
{
urlbuf, "/_matrix/federation/v1/backfill/%s/?limit=%zu&v=%s",
url::encode(room_id, ridbuf),
opts.limit,
url::encode(opts.event_id, eidbuf),
};
}
json::get<"method"_>(opts.request) = "GET";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/state.h
//
ircd::m::v1::state::state(const room::id &room_id,
const mutable_buffer &buf)
:state
{
room_id, buf, opts{}
}
{
}
ircd::m::v1::state::state(const room::id &room_id,
const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
if(!opts.remote)
opts.remote = room_id.host();
m::event::id::buf event_id_buf;
if(!opts.event_id)
{
event_id_buf = fetch_head(room_id, opts.remote);
opts.event_id = event_id_buf;
}
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(defined(json::get<"content"_>(opts.request)))
opts.out.content = json::get<"content"_>(opts.request);
if(!defined(json::get<"content"_>(opts.request)))
json::get<"content"_>(opts.request) = json::object{opts.out.content};
if(!defined(json::get<"uri"_>(opts.request)))
{
thread_local char urlbuf[2048], ridbuf[768], eidbuf[768];
json::get<"uri"_>(opts.request) = fmt::sprintf
{
urlbuf, "/_matrix/federation/v1/%s/%s/?event_id=%s",
opts.ids_only? "state_ids" : "state",
url::encode(room_id, ridbuf),
url::encode(opts.event_id, eidbuf),
};
}
json::get<"method"_>(opts.request) = "GET";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/event_auth.h
//
ircd::m::v1::event_auth::event_auth(const m::room::id &room_id,
const m::event::id &event_id,
const mutable_buffer &buf)
:event_auth
{
room_id, event_id, buf, opts{}
}
{
}
ircd::m::v1::event_auth::event_auth(const m::room::id &room_id,
const m::event::id &event_id,
const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
if(!opts.remote)
opts.remote = event_id.host();
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(defined(json::get<"content"_>(opts.request)))
opts.out.content = json::get<"content"_>(opts.request);
if(!defined(json::get<"content"_>(opts.request)))
json::get<"content"_>(opts.request) = json::object{opts.out.content};
if(!defined(json::get<"uri"_>(opts.request)))
{
thread_local char urlbuf[2048], ridbuf[768], eidbuf[768];
json::get<"uri"_>(opts.request) = fmt::sprintf
{
urlbuf, "/_matrix/federation/v1/event_auth/%s/%s",
url::encode(room_id, ridbuf),
url::encode(event_id, eidbuf),
};
}
json::get<"method"_>(opts.request) = "GET";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/event.h
//
ircd::m::v1::event::event(const m::event::id &event_id,
const mutable_buffer &buf)
:event
{
event_id, buf, opts{}
}
{
}
ircd::m::v1::event::event(const m::event::id &event_id,
const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
if(!opts.remote)
opts.remote = event_id.host();
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(defined(json::get<"content"_>(opts.request)))
opts.out.content = json::get<"content"_>(opts.request);
if(!defined(json::get<"content"_>(opts.request)))
json::get<"content"_>(opts.request) = json::object{opts.out.content};
if(!defined(json::get<"uri"_>(opts.request)))
{
thread_local char urlbuf[1024], eidbuf[768];
json::get<"uri"_>(opts.request) = fmt::sprintf
{
urlbuf, "/_matrix/federation/v1/event/%s/",
url::encode(event_id, eidbuf),
};
}
json::get<"method"_>(opts.request) = "GET";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/invite.h
//
ircd::m::v1::invite::invite(const room::id &room_id,
const id::event &event_id,
const json::object &content,
const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
assert(!!opts.remote);
assert(!size(opts.out.content));
opts.out.content = content;
assert(!defined(json::get<"content"_>(opts.request)));
json::get<"content"_>(opts.request) = json::object{opts.out.content};
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(!defined(json::get<"uri"_>(opts.request)))
{
thread_local char urlbuf[2048], ridbuf[768], eidbuf[768];
json::get<"uri"_>(opts.request) = fmt::sprintf
{
urlbuf, "/_matrix/federation/v1/invite/%s/%s",
url::encode(room_id, ridbuf),
url::encode(event_id, eidbuf)
};
}
json::get<"method"_>(opts.request) = "PUT";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/send_join.h
//
ircd::m::v1::send_join::send_join(const room::id &room_id,
const id::event &event_id,
const const_buffer &content,
const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
assert(!!opts.remote);
assert(!size(opts.out.content));
opts.out.content = content;
assert(!defined(json::get<"content"_>(opts.request)));
json::get<"content"_>(opts.request) = json::object{opts.out.content};
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(!defined(json::get<"uri"_>(opts.request)))
{
thread_local char urlbuf[2048], ridbuf[768], uidbuf[768];
json::get<"uri"_>(opts.request) = fmt::sprintf
{
urlbuf, "/_matrix/federation/v1/send_join/%s/%s",
url::encode(room_id, ridbuf),
url::encode(event_id, uidbuf)
};
}
json::get<"method"_>(opts.request) = "PUT";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/make_join.h
//
ircd::m::v1::make_join::make_join(const room::id &room_id,
const id::user &user_id,
const mutable_buffer &buf)
:make_join
{
room_id, user_id, buf, opts{}
}
{
}
ircd::m::v1::make_join::make_join(const room::id &room_id,
const id::user &user_id,
const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
if(!opts.remote)
opts.remote = room_id.host();
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(defined(json::get<"content"_>(opts.request)))
opts.out.content = json::get<"content"_>(opts.request);
if(!defined(json::get<"content"_>(opts.request)))
json::get<"content"_>(opts.request) = json::object{opts.out.content};
if(!defined(json::get<"uri"_>(opts.request)))
{
thread_local char urlbuf[2048], ridbuf[768], uidbuf[768];
json::get<"uri"_>(opts.request) = fmt::sprintf
{
urlbuf, "/_matrix/federation/v1/make_join/%s/%s",
url::encode(room_id, ridbuf),
url::encode(user_id, uidbuf)
};
}
json::get<"method"_>(opts.request) = "GET";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/user.h
//
ircd::m::v1::user::devices::devices(const id::user &user_id,
const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
if(!opts.remote)
opts.remote = user_id.host();
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(!defined(json::get<"uri"_>(opts.request)))
{
thread_local char urlbuf[2048], uidbuf[768];
json::get<"uri"_>(opts.request) = fmt::sprintf
{
urlbuf, "/_matrix/federation/v1/user/devices/%s",
url::encode(user_id, uidbuf)
};
}
if(defined(json::get<"content"_>(opts.request)))
opts.out.content = json::get<"content"_>(opts.request);
if(!defined(json::get<"method"_>(opts.request)))
json::get<"method"_>(opts.request) = "GET";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/query.h
//
namespace ircd::m::v1
{
thread_local char query_arg_buf[1024];
thread_local char query_url_buf[1024];
}
ircd::m::v1::query::client_keys::client_keys(const id::user &user_id,
const string_view &device_id,
const mutable_buffer &buf)
:client_keys
{
user_id, device_id, buf, opts{user_id.host()}
}
{
}
ircd::m::v1::query::client_keys::client_keys(const id::user &user_id,
const string_view &device_id,
const mutable_buffer &buf,
opts opts)
:query{[&]() -> query
{
const json::value device_ids[]
{
{ device_id }
};
const json::members body
{
{ "device_keys", json::members
{
{ string_view{user_id}, { device_ids, 1 } }
}}
};
mutable_buffer out{buf};
const string_view content
{
stringify(out, body)
};
json::get<"content"_>(opts.request) = content;
return
{
"client_keys", string_view{}, out, std::move(opts)
};
}()}
{
}
ircd::m::v1::query::user_devices::user_devices(const id::user &user_id,
const mutable_buffer &buf)
:user_devices
{
user_id, buf, opts{user_id.host()}
}
{
}
ircd::m::v1::query::user_devices::user_devices(const id::user &user_id,
const mutable_buffer &buf,
opts opts)
:query
{
"user_devices",
fmt::sprintf
{
query_arg_buf, "user_id=%s", url::encode(user_id, query_url_buf)
},
buf,
std::move(opts)
}
{
}
ircd::m::v1::query::directory::directory(const id::room_alias &room_alias,
const mutable_buffer &buf)
:directory
{
room_alias, buf, opts{room_alias.host()}
}
{
}
ircd::m::v1::query::directory::directory(const id::room_alias &room_alias,
const mutable_buffer &buf,
opts opts)
:query
{
"directory",
fmt::sprintf
{
query_arg_buf, "room_alias=%s", url::encode(room_alias, query_url_buf)
},
buf,
std::move(opts)
}
{
}
ircd::m::v1::query::profile::profile(const id::user &user_id,
const mutable_buffer &buf)
:profile
{
user_id, buf, opts{user_id.host()}
}
{
}
ircd::m::v1::query::profile::profile(const id::user &user_id,
const mutable_buffer &buf,
opts opts)
:query
{
"profile",
fmt::sprintf
{
query_arg_buf, "user_id=%s", url::encode(user_id, query_url_buf)
},
buf,
std::move(opts)
}
{
}
ircd::m::v1::query::profile::profile(const id::user &user_id,
const string_view &field,
const mutable_buffer &buf)
:profile
{
user_id, field, buf, opts{user_id.host()}
}
{
}
ircd::m::v1::query::profile::profile(const id::user &user_id,
const string_view &field,
const mutable_buffer &buf,
opts opts)
:query
{
"profile",
fmt::sprintf
{
query_arg_buf, "user_id=%s%s%s",
url::encode(string_view{user_id}, query_url_buf),
!empty(field)? "&field=" : "",
field
},
buf,
std::move(opts)
}
{
}
ircd::m::v1::query::query(const string_view &type,
const string_view &args,
const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
assert(!!opts.remote);
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(!defined(json::get<"uri"_>(opts.request)))
{
thread_local char urlbuf[2048];
json::get<"uri"_>(opts.request) = fmt::sprintf
{
urlbuf, "/_matrix/federation/v1/query/%s%s%s",
type,
args? "?"_sv : ""_sv,
args
};
}
if(defined(json::get<"content"_>(opts.request)))
opts.out.content = json::get<"content"_>(opts.request);
if(!defined(json::get<"method"_>(opts.request)))
json::get<"method"_>(opts.request) = "GET";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/key.h
//
ircd::m::v1::key::keys::keys(const string_view &server_name,
const mutable_buffer &buf,
opts opts)
:keys
{
server_key{server_name, ""}, buf, std::move(opts)
}
{
}
ircd::m::v1::key::keys::keys(const server_key &server_key,
const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
const auto &server_name{server_key.first};
const auto &key_id{server_key.second};
if(!opts.remote)
opts.remote = net::hostport{server_name};
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(defined(json::get<"content"_>(opts.request)))
opts.out.content = json::get<"content"_>(opts.request);
if(!defined(json::get<"content"_>(opts.request)))
json::get<"content"_>(opts.request) = json::object{opts.out.content};
if(!defined(json::get<"uri"_>(opts.request)))
{
if(!empty(key_id))
{
thread_local char uribuf[512];
json::get<"uri"_>(opts.request) = fmt::sprintf
{
uribuf, "/_matrix/key/v2/server/%s/", key_id
};
}
else json::get<"uri"_>(opts.request) = "/_matrix/key/v2/server/";
}
json::get<"method"_>(opts.request) = "GET";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
namespace ircd::m::v1
{
static const_buffer
_make_server_keys(const vector_view<const key::server_key> &,
const mutable_buffer &);
}
ircd::m::v1::key::query::query(const vector_view<const server_key> &keys,
const mutable_buffer &buf_,
opts opts)
:server::request{[&]
{
assert(!!opts.remote);
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(defined(json::get<"content"_>(opts.request)))
opts.out.content = json::get<"content"_>(opts.request);
if(!defined(json::get<"content"_>(opts.request)))
json::get<"content"_>(opts.request) = json::object{opts.out.content};
if(!defined(json::get<"uri"_>(opts.request)))
json::get<"uri"_>(opts.request) = "/_matrix/key/v2/query";
json::get<"method"_>(opts.request) = "POST";
window_buffer buf{buf_};
if(!defined(json::get<"content"_>(opts.request)))
{
buf([&keys](const mutable_buffer &buf)
{
return _make_server_keys(keys, buf);
});
json::get<"content"_>(opts.request) = json::object{buf.completed()};
opts.out.content = json::get<"content"_>(opts.request);
}
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
static ircd::const_buffer
ircd::m::v1::_make_server_keys(const vector_view<const key::server_key> &keys,
const mutable_buffer &buf)
{
json::stack out{buf};
{
json::stack::object top{out};
json::stack::member server_keys{top, "server_keys"};
json::stack::object keys_object{server_keys};
for(const auto &sk : keys)
{
json::stack::member server_name{keys_object, sk.first};
json::stack::object server_object{server_name};
json::stack::member key_name{server_object, sk.second};
json::stack::object key_object{key_name};
json::stack::member mvut
{
key_object, "minimum_valid_until_ts", json::value{0L}
};
}
}
return out.completed();
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/version.h
//
ircd::m::v1::version::version(const mutable_buffer &buf,
opts opts)
:server::request{[&]
{
assert(!!opts.remote);
if(!defined(json::get<"origin"_>(opts.request)))
json::get<"origin"_>(opts.request) = my_host();
if(!defined(json::get<"destination"_>(opts.request)))
json::get<"destination"_>(opts.request) = host(opts.remote);
if(!defined(json::get<"uri"_>(opts.request)))
json::get<"uri"_>(opts.request) = "/_matrix/federation/v1/version";
json::get<"method"_>(opts.request) = "GET";
opts.out.head = opts.request(buf);
if(!size(opts.in))
{
opts.in.head = buf + size(opts.out.head);
opts.in.content = opts.dynamic?
mutable_buffer{}: // server::request will allocate new mem
opts.in.head; // server::request will auto partition
}
return server::request
{
opts.remote, std::move(opts.out), std::move(opts.in), opts.sopts
};
}()}
{
}
///////////////////////////////////////////////////////////////////////////////
//
// v1/v1.h
//
ircd::conf::item<ircd::milliseconds>
fetch_head_timeout
{
{ "name", "ircd.m.v1.fetch_head.timeout" },
{ "default", 30 * 1000L },
};
ircd::m::event::id::buf
ircd::m::v1::fetch_head(const id::room &room_id,
const net::hostport &remote)
{
return fetch_head(room_id, remote, m::me.user_id);
}
ircd::m::event::id::buf
ircd::m::v1::fetch_head(const id::room &room_id,
const net::hostport &remote,
const id::user &user_id)
{
const unique_buffer<mutable_buffer> buf
{
16_KiB
};
make_join::opts opts;
opts.remote = remote;
make_join request
{
room_id, user_id, buf, std::move(opts)
};
request.wait(milliseconds(fetch_head_timeout));
request.get();
const json::object proto
{
request.in.content
};
const json::array prev_events
{
proto.at({"event", "prev_events"})
};
const json::array prev_event
{
prev_events.at(0)
};
const auto &prev_event_id
{
prev_event.at(0)
};
return unquote(prev_event_id);
}
| [
"jason@zemos.net"
] | jason@zemos.net |
e2d2d0833be3ac51ebcf6718947e05410b54824f | 1d0cc97e2b516249f9852e3f3d8a915a6d4890f4 | /_Team 11 - Documents and Builds/Game Builds/Windows/ClueGame_Ver1.1/Clue!_BackUpThisFolder_ButDontShipItWithYourGame/il2cppOutput/UnityEngine.InputLegacyModule.cpp | a4a07774a2147cddf0485c86a64d01f2098b9cb7 | [] | no_license | PsychoNudalz/ClueGame | 2e0c4286122b34223541305f197b2d768b544cae | c859edd1097dd87f1f09f4ce5a71f7270d6996c2 | refs/heads/master | 2023-05-09T01:34:50.690590 | 2021-04-28T20:58:09 | 2021-04-28T20:58:09 | 333,177,592 | 0 | 0 | null | 2021-04-20T11:33:50 | 2021-01-26T18:26:04 | C# | UTF-8 | C++ | false | false | 148,739 | cpp | #include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <cstring>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <limits>
#include <assert.h>
#include <stdint.h>
#include "codegen/il2cpp-codegen.h"
#include "il2cpp-object-internals.h"
// System.Char[]
struct CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2;
// System.String
struct String_t;
// System.Void
struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017;
// UnityEngine.Camera
struct Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34;
// UnityEngine.Camera/CameraCallback
struct CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0;
// UnityEngine.Camera[]
struct CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9;
// UnityEngine.Display
struct Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57;
// UnityEngine.Display/DisplaysUpdatedDelegate
struct DisplaysUpdatedDelegate_t2FAF995B47D691BD7C5BBC17D533DD8B19BE9A90;
// UnityEngine.Display[]
struct DisplayU5BU5D_tB2AB0FDB3B2E9FD784D5100C18EB0ED489A2CCC9;
// UnityEngine.GameObject
struct GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F;
// UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0;
// UnityEngine.RenderTexture
struct RenderTexture_tBC47D853E3DA6511CD6C49DBF78D47B890FCD2F6;
// UnityEngine.SendMouseEvents/HitInfo[]
struct HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1;
IL2CPP_EXTERN_C RuntimeClass* CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C RuntimeClass* Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_il2cpp_TypeInfo_var;
IL2CPP_EXTERN_C String_t* _stringLiteral38C0F0DBDBD6845E1EB1973902069AA0D04A49CB;
IL2CPP_EXTERN_C String_t* _stringLiteral3FD91E160022E3A1414EFC9052F3C6C31F1EA4F4;
IL2CPP_EXTERN_C String_t* _stringLiteralA7657254AB620ED4022229A87EBBB2D61A66BB47;
IL2CPP_EXTERN_C String_t* _stringLiteralAEEBD5451CD610FD41B563142B1715878FB6841E;
IL2CPP_EXTERN_C String_t* _stringLiteralB8B6C4E8F01128F85B1997A2FC54F0D8A7847473;
IL2CPP_EXTERN_C String_t* _stringLiteralC2DD4A1CF2BEA8DC20037D0E70DA4065B69442E6;
IL2CPP_EXTERN_C String_t* _stringLiteralD0F250C5C723619F2F208B1992BA356D32807BE6;
IL2CPP_EXTERN_C const uint32_t HitInfo_Compare_m5643F7A11E2F60B86286330548DF614BD9691582_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t HitInfo_op_Implicit_mBB6DB77D68B22445EC255E34E7EE7667FD584322_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t SendMouseEvents_DoSendMouseEvents_m045BF5CABD2F263140E5F1427F81702EE0D3C507_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t SendMouseEvents_SendEvents_m2E266CFBE23F89BA8563312C8488DF1E9A7C25F0_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t SendMouseEvents_SetMouseMoved_m9B185D9ECD0C159C5DFA17F8F0ECBFD3420F32A6_MetadataUsageId;
IL2CPP_EXTERN_C const uint32_t SendMouseEvents__cctor_m702309EA7759031619D3963B6EA517ABEB888053_MetadataUsageId;
struct CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9;
struct DisplayU5BU5D_tB2AB0FDB3B2E9FD784D5100C18EB0ED489A2CCC9;
struct HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1;
IL2CPP_EXTERN_C_BEGIN
IL2CPP_EXTERN_C_END
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// <Module>
struct U3CModuleU3E_tA591571AD0F1B8BA034C523CD27F8800C0345102
{
public:
public:
};
// System.Object
struct Il2CppArrayBounds;
// System.Array
// System.String
struct String_t : public RuntimeObject
{
public:
// System.Int32 System.String::m_stringLength
int32_t ___m_stringLength_0;
// System.Char System.String::m_firstChar
Il2CppChar ___m_firstChar_1;
public:
inline static int32_t get_offset_of_m_stringLength_0() { return static_cast<int32_t>(offsetof(String_t, ___m_stringLength_0)); }
inline int32_t get_m_stringLength_0() const { return ___m_stringLength_0; }
inline int32_t* get_address_of_m_stringLength_0() { return &___m_stringLength_0; }
inline void set_m_stringLength_0(int32_t value)
{
___m_stringLength_0 = value;
}
inline static int32_t get_offset_of_m_firstChar_1() { return static_cast<int32_t>(offsetof(String_t, ___m_firstChar_1)); }
inline Il2CppChar get_m_firstChar_1() const { return ___m_firstChar_1; }
inline Il2CppChar* get_address_of_m_firstChar_1() { return &___m_firstChar_1; }
inline void set_m_firstChar_1(Il2CppChar value)
{
___m_firstChar_1 = value;
}
};
struct String_t_StaticFields
{
public:
// System.String System.String::Empty
String_t* ___Empty_5;
public:
inline static int32_t get_offset_of_Empty_5() { return static_cast<int32_t>(offsetof(String_t_StaticFields, ___Empty_5)); }
inline String_t* get_Empty_5() const { return ___Empty_5; }
inline String_t** get_address_of_Empty_5() { return &___Empty_5; }
inline void set_Empty_5(String_t* value)
{
___Empty_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___Empty_5), (void*)value);
}
};
// System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF : public RuntimeObject
{
public:
public:
};
// Native definition for P/Invoke marshalling of System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.ValueType
struct ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF_marshaled_com
{
};
// UnityEngine.CameraRaycastHelper
struct CameraRaycastHelper_tD4019A7B955AB1B53870F68889B611A1ADAF1E05 : public RuntimeObject
{
public:
public:
};
// UnityEngine.Input
struct Input_tCCB96DE9636DD2C1993637958AA227434290E523 : public RuntimeObject
{
public:
public:
};
// UnityEngine.SendMouseEvents
struct SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666 : public RuntimeObject
{
public:
public:
};
struct SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields
{
public:
// System.Boolean UnityEngine.SendMouseEvents::s_MouseUsed
bool ___s_MouseUsed_0;
// UnityEngine.SendMouseEvents/HitInfo[] UnityEngine.SendMouseEvents::m_LastHit
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* ___m_LastHit_1;
// UnityEngine.SendMouseEvents/HitInfo[] UnityEngine.SendMouseEvents::m_MouseDownHit
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* ___m_MouseDownHit_2;
// UnityEngine.SendMouseEvents/HitInfo[] UnityEngine.SendMouseEvents::m_CurrentHit
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* ___m_CurrentHit_3;
// UnityEngine.Camera[] UnityEngine.SendMouseEvents::m_Cameras
CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* ___m_Cameras_4;
public:
inline static int32_t get_offset_of_s_MouseUsed_0() { return static_cast<int32_t>(offsetof(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields, ___s_MouseUsed_0)); }
inline bool get_s_MouseUsed_0() const { return ___s_MouseUsed_0; }
inline bool* get_address_of_s_MouseUsed_0() { return &___s_MouseUsed_0; }
inline void set_s_MouseUsed_0(bool value)
{
___s_MouseUsed_0 = value;
}
inline static int32_t get_offset_of_m_LastHit_1() { return static_cast<int32_t>(offsetof(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields, ___m_LastHit_1)); }
inline HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* get_m_LastHit_1() const { return ___m_LastHit_1; }
inline HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1** get_address_of_m_LastHit_1() { return &___m_LastHit_1; }
inline void set_m_LastHit_1(HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* value)
{
___m_LastHit_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_LastHit_1), (void*)value);
}
inline static int32_t get_offset_of_m_MouseDownHit_2() { return static_cast<int32_t>(offsetof(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields, ___m_MouseDownHit_2)); }
inline HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* get_m_MouseDownHit_2() const { return ___m_MouseDownHit_2; }
inline HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1** get_address_of_m_MouseDownHit_2() { return &___m_MouseDownHit_2; }
inline void set_m_MouseDownHit_2(HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* value)
{
___m_MouseDownHit_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_MouseDownHit_2), (void*)value);
}
inline static int32_t get_offset_of_m_CurrentHit_3() { return static_cast<int32_t>(offsetof(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields, ___m_CurrentHit_3)); }
inline HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* get_m_CurrentHit_3() const { return ___m_CurrentHit_3; }
inline HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1** get_address_of_m_CurrentHit_3() { return &___m_CurrentHit_3; }
inline void set_m_CurrentHit_3(HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* value)
{
___m_CurrentHit_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_CurrentHit_3), (void*)value);
}
inline static int32_t get_offset_of_m_Cameras_4() { return static_cast<int32_t>(offsetof(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields, ___m_Cameras_4)); }
inline CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* get_m_Cameras_4() const { return ___m_Cameras_4; }
inline CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9** get_address_of_m_Cameras_4() { return &___m_Cameras_4; }
inline void set_m_Cameras_4(CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* value)
{
___m_Cameras_4 = value;
Il2CppCodeGenWriteBarrier((void**)(&___m_Cameras_4), (void*)value);
}
};
// System.Boolean
struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C
{
public:
// System.Boolean System.Boolean::m_value
bool ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C, ___m_value_0)); }
inline bool get_m_value_0() const { return ___m_value_0; }
inline bool* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(bool value)
{
___m_value_0 = value;
}
};
struct Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields
{
public:
// System.String System.Boolean::TrueString
String_t* ___TrueString_5;
// System.String System.Boolean::FalseString
String_t* ___FalseString_6;
public:
inline static int32_t get_offset_of_TrueString_5() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___TrueString_5)); }
inline String_t* get_TrueString_5() const { return ___TrueString_5; }
inline String_t** get_address_of_TrueString_5() { return &___TrueString_5; }
inline void set_TrueString_5(String_t* value)
{
___TrueString_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___TrueString_5), (void*)value);
}
inline static int32_t get_offset_of_FalseString_6() { return static_cast<int32_t>(offsetof(Boolean_tB53F6830F670160873277339AA58F15CAED4399C_StaticFields, ___FalseString_6)); }
inline String_t* get_FalseString_6() const { return ___FalseString_6; }
inline String_t** get_address_of_FalseString_6() { return &___FalseString_6; }
inline void set_FalseString_6(String_t* value)
{
___FalseString_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&___FalseString_6), (void*)value);
}
};
// System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521 : public ValueType_t4D0C27076F7C36E76190FB3328E232BCB1CD1FFF
{
public:
public:
};
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields
{
public:
// System.Char[] System.Enum::enumSeperatorCharArray
CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* ___enumSeperatorCharArray_0;
public:
inline static int32_t get_offset_of_enumSeperatorCharArray_0() { return static_cast<int32_t>(offsetof(Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_StaticFields, ___enumSeperatorCharArray_0)); }
inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* get_enumSeperatorCharArray_0() const { return ___enumSeperatorCharArray_0; }
inline CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2** get_address_of_enumSeperatorCharArray_0() { return &___enumSeperatorCharArray_0; }
inline void set_enumSeperatorCharArray_0(CharU5BU5D_t4CC6ABF0AD71BEC97E3C2F1E9C5677E46D3A75C2* value)
{
___enumSeperatorCharArray_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___enumSeperatorCharArray_0), (void*)value);
}
};
// Native definition for P/Invoke marshalling of System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_pinvoke
{
};
// Native definition for COM marshalling of System.Enum
struct Enum_t2AF27C02B8653AE29442467390005ABC74D8F521_marshaled_com
{
};
// System.Int32
struct Int32_t585191389E07734F19F3156FF88FB3EF4800D102
{
public:
// System.Int32 System.Int32::m_value
int32_t ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Int32_t585191389E07734F19F3156FF88FB3EF4800D102, ___m_value_0)); }
inline int32_t get_m_value_0() const { return ___m_value_0; }
inline int32_t* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(int32_t value)
{
___m_value_0 = value;
}
};
// System.IntPtr
struct IntPtr_t
{
public:
// System.Void* System.IntPtr::m_value
void* ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(IntPtr_t, ___m_value_0)); }
inline void* get_m_value_0() const { return ___m_value_0; }
inline void** get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(void* value)
{
___m_value_0 = value;
}
};
struct IntPtr_t_StaticFields
{
public:
// System.IntPtr System.IntPtr::Zero
intptr_t ___Zero_1;
public:
inline static int32_t get_offset_of_Zero_1() { return static_cast<int32_t>(offsetof(IntPtr_t_StaticFields, ___Zero_1)); }
inline intptr_t get_Zero_1() const { return ___Zero_1; }
inline intptr_t* get_address_of_Zero_1() { return &___Zero_1; }
inline void set_Zero_1(intptr_t value)
{
___Zero_1 = value;
}
};
// System.Single
struct Single_tDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1
{
public:
// System.Single System.Single::m_value
float ___m_value_0;
public:
inline static int32_t get_offset_of_m_value_0() { return static_cast<int32_t>(offsetof(Single_tDDDA9169C4E4E308AC6D7A824F9B28DC82204AE1, ___m_value_0)); }
inline float get_m_value_0() const { return ___m_value_0; }
inline float* get_address_of_m_value_0() { return &___m_value_0; }
inline void set_m_value_0(float value)
{
___m_value_0 = value;
}
};
// System.Void
struct Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017
{
public:
union
{
struct
{
};
uint8_t Void_t22962CB4C05B1D89B55A6E1139F0E87A90987017__padding[1];
};
public:
};
// UnityEngine.Rect
struct Rect_t35B976DE901B5423C11705E156938EA27AB402CE
{
public:
// System.Single UnityEngine.Rect::m_XMin
float ___m_XMin_0;
// System.Single UnityEngine.Rect::m_YMin
float ___m_YMin_1;
// System.Single UnityEngine.Rect::m_Width
float ___m_Width_2;
// System.Single UnityEngine.Rect::m_Height
float ___m_Height_3;
public:
inline static int32_t get_offset_of_m_XMin_0() { return static_cast<int32_t>(offsetof(Rect_t35B976DE901B5423C11705E156938EA27AB402CE, ___m_XMin_0)); }
inline float get_m_XMin_0() const { return ___m_XMin_0; }
inline float* get_address_of_m_XMin_0() { return &___m_XMin_0; }
inline void set_m_XMin_0(float value)
{
___m_XMin_0 = value;
}
inline static int32_t get_offset_of_m_YMin_1() { return static_cast<int32_t>(offsetof(Rect_t35B976DE901B5423C11705E156938EA27AB402CE, ___m_YMin_1)); }
inline float get_m_YMin_1() const { return ___m_YMin_1; }
inline float* get_address_of_m_YMin_1() { return &___m_YMin_1; }
inline void set_m_YMin_1(float value)
{
___m_YMin_1 = value;
}
inline static int32_t get_offset_of_m_Width_2() { return static_cast<int32_t>(offsetof(Rect_t35B976DE901B5423C11705E156938EA27AB402CE, ___m_Width_2)); }
inline float get_m_Width_2() const { return ___m_Width_2; }
inline float* get_address_of_m_Width_2() { return &___m_Width_2; }
inline void set_m_Width_2(float value)
{
___m_Width_2 = value;
}
inline static int32_t get_offset_of_m_Height_3() { return static_cast<int32_t>(offsetof(Rect_t35B976DE901B5423C11705E156938EA27AB402CE, ___m_Height_3)); }
inline float get_m_Height_3() const { return ___m_Height_3; }
inline float* get_address_of_m_Height_3() { return &___m_Height_3; }
inline void set_m_Height_3(float value)
{
___m_Height_3 = value;
}
};
// UnityEngine.SendMouseEvents/HitInfo
struct HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746
{
public:
// UnityEngine.GameObject UnityEngine.SendMouseEvents/HitInfo::target
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * ___target_0;
// UnityEngine.Camera UnityEngine.SendMouseEvents/HitInfo::camera
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * ___camera_1;
public:
inline static int32_t get_offset_of_target_0() { return static_cast<int32_t>(offsetof(HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746, ___target_0)); }
inline GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * get_target_0() const { return ___target_0; }
inline GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F ** get_address_of_target_0() { return &___target_0; }
inline void set_target_0(GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * value)
{
___target_0 = value;
Il2CppCodeGenWriteBarrier((void**)(&___target_0), (void*)value);
}
inline static int32_t get_offset_of_camera_1() { return static_cast<int32_t>(offsetof(HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746, ___camera_1)); }
inline Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * get_camera_1() const { return ___camera_1; }
inline Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 ** get_address_of_camera_1() { return &___camera_1; }
inline void set_camera_1(Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * value)
{
___camera_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___camera_1), (void*)value);
}
};
// Native definition for P/Invoke marshalling of UnityEngine.SendMouseEvents/HitInfo
struct HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshaled_pinvoke
{
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * ___target_0;
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * ___camera_1;
};
// Native definition for COM marshalling of UnityEngine.SendMouseEvents/HitInfo
struct HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshaled_com
{
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * ___target_0;
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * ___camera_1;
};
// UnityEngine.Vector2
struct Vector2_tA85D2DD88578276CA8A8796756458277E72D073D
{
public:
// System.Single UnityEngine.Vector2::x
float ___x_0;
// System.Single UnityEngine.Vector2::y
float ___y_1;
public:
inline static int32_t get_offset_of_x_0() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D, ___x_0)); }
inline float get_x_0() const { return ___x_0; }
inline float* get_address_of_x_0() { return &___x_0; }
inline void set_x_0(float value)
{
___x_0 = value;
}
inline static int32_t get_offset_of_y_1() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D, ___y_1)); }
inline float get_y_1() const { return ___y_1; }
inline float* get_address_of_y_1() { return &___y_1; }
inline void set_y_1(float value)
{
___y_1 = value;
}
};
struct Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields
{
public:
// UnityEngine.Vector2 UnityEngine.Vector2::zeroVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___zeroVector_2;
// UnityEngine.Vector2 UnityEngine.Vector2::oneVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___oneVector_3;
// UnityEngine.Vector2 UnityEngine.Vector2::upVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___upVector_4;
// UnityEngine.Vector2 UnityEngine.Vector2::downVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___downVector_5;
// UnityEngine.Vector2 UnityEngine.Vector2::leftVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___leftVector_6;
// UnityEngine.Vector2 UnityEngine.Vector2::rightVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___rightVector_7;
// UnityEngine.Vector2 UnityEngine.Vector2::positiveInfinityVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___positiveInfinityVector_8;
// UnityEngine.Vector2 UnityEngine.Vector2::negativeInfinityVector
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___negativeInfinityVector_9;
public:
inline static int32_t get_offset_of_zeroVector_2() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___zeroVector_2)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_zeroVector_2() const { return ___zeroVector_2; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_zeroVector_2() { return &___zeroVector_2; }
inline void set_zeroVector_2(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___zeroVector_2 = value;
}
inline static int32_t get_offset_of_oneVector_3() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___oneVector_3)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_oneVector_3() const { return ___oneVector_3; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_oneVector_3() { return &___oneVector_3; }
inline void set_oneVector_3(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___oneVector_3 = value;
}
inline static int32_t get_offset_of_upVector_4() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___upVector_4)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_upVector_4() const { return ___upVector_4; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_upVector_4() { return &___upVector_4; }
inline void set_upVector_4(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___upVector_4 = value;
}
inline static int32_t get_offset_of_downVector_5() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___downVector_5)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_downVector_5() const { return ___downVector_5; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_downVector_5() { return &___downVector_5; }
inline void set_downVector_5(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___downVector_5 = value;
}
inline static int32_t get_offset_of_leftVector_6() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___leftVector_6)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_leftVector_6() const { return ___leftVector_6; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_leftVector_6() { return &___leftVector_6; }
inline void set_leftVector_6(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___leftVector_6 = value;
}
inline static int32_t get_offset_of_rightVector_7() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___rightVector_7)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_rightVector_7() const { return ___rightVector_7; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_rightVector_7() { return &___rightVector_7; }
inline void set_rightVector_7(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___rightVector_7 = value;
}
inline static int32_t get_offset_of_positiveInfinityVector_8() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___positiveInfinityVector_8)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_positiveInfinityVector_8() const { return ___positiveInfinityVector_8; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_positiveInfinityVector_8() { return &___positiveInfinityVector_8; }
inline void set_positiveInfinityVector_8(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___positiveInfinityVector_8 = value;
}
inline static int32_t get_offset_of_negativeInfinityVector_9() { return static_cast<int32_t>(offsetof(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D_StaticFields, ___negativeInfinityVector_9)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_negativeInfinityVector_9() const { return ___negativeInfinityVector_9; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_negativeInfinityVector_9() { return &___negativeInfinityVector_9; }
inline void set_negativeInfinityVector_9(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___negativeInfinityVector_9 = value;
}
};
// UnityEngine.Vector3
struct Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720
{
public:
// System.Single UnityEngine.Vector3::x
float ___x_2;
// System.Single UnityEngine.Vector3::y
float ___y_3;
// System.Single UnityEngine.Vector3::z
float ___z_4;
public:
inline static int32_t get_offset_of_x_2() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720, ___x_2)); }
inline float get_x_2() const { return ___x_2; }
inline float* get_address_of_x_2() { return &___x_2; }
inline void set_x_2(float value)
{
___x_2 = value;
}
inline static int32_t get_offset_of_y_3() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720, ___y_3)); }
inline float get_y_3() const { return ___y_3; }
inline float* get_address_of_y_3() { return &___y_3; }
inline void set_y_3(float value)
{
___y_3 = value;
}
inline static int32_t get_offset_of_z_4() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720, ___z_4)); }
inline float get_z_4() const { return ___z_4; }
inline float* get_address_of_z_4() { return &___z_4; }
inline void set_z_4(float value)
{
___z_4 = value;
}
};
struct Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields
{
public:
// UnityEngine.Vector3 UnityEngine.Vector3::zeroVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___zeroVector_5;
// UnityEngine.Vector3 UnityEngine.Vector3::oneVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___oneVector_6;
// UnityEngine.Vector3 UnityEngine.Vector3::upVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___upVector_7;
// UnityEngine.Vector3 UnityEngine.Vector3::downVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___downVector_8;
// UnityEngine.Vector3 UnityEngine.Vector3::leftVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___leftVector_9;
// UnityEngine.Vector3 UnityEngine.Vector3::rightVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___rightVector_10;
// UnityEngine.Vector3 UnityEngine.Vector3::forwardVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___forwardVector_11;
// UnityEngine.Vector3 UnityEngine.Vector3::backVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___backVector_12;
// UnityEngine.Vector3 UnityEngine.Vector3::positiveInfinityVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___positiveInfinityVector_13;
// UnityEngine.Vector3 UnityEngine.Vector3::negativeInfinityVector
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___negativeInfinityVector_14;
public:
inline static int32_t get_offset_of_zeroVector_5() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___zeroVector_5)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_zeroVector_5() const { return ___zeroVector_5; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_zeroVector_5() { return &___zeroVector_5; }
inline void set_zeroVector_5(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___zeroVector_5 = value;
}
inline static int32_t get_offset_of_oneVector_6() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___oneVector_6)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_oneVector_6() const { return ___oneVector_6; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_oneVector_6() { return &___oneVector_6; }
inline void set_oneVector_6(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___oneVector_6 = value;
}
inline static int32_t get_offset_of_upVector_7() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___upVector_7)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_upVector_7() const { return ___upVector_7; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_upVector_7() { return &___upVector_7; }
inline void set_upVector_7(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___upVector_7 = value;
}
inline static int32_t get_offset_of_downVector_8() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___downVector_8)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_downVector_8() const { return ___downVector_8; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_downVector_8() { return &___downVector_8; }
inline void set_downVector_8(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___downVector_8 = value;
}
inline static int32_t get_offset_of_leftVector_9() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___leftVector_9)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_leftVector_9() const { return ___leftVector_9; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_leftVector_9() { return &___leftVector_9; }
inline void set_leftVector_9(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___leftVector_9 = value;
}
inline static int32_t get_offset_of_rightVector_10() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___rightVector_10)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_rightVector_10() const { return ___rightVector_10; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_rightVector_10() { return &___rightVector_10; }
inline void set_rightVector_10(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___rightVector_10 = value;
}
inline static int32_t get_offset_of_forwardVector_11() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___forwardVector_11)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_forwardVector_11() const { return ___forwardVector_11; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_forwardVector_11() { return &___forwardVector_11; }
inline void set_forwardVector_11(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___forwardVector_11 = value;
}
inline static int32_t get_offset_of_backVector_12() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___backVector_12)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_backVector_12() const { return ___backVector_12; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_backVector_12() { return &___backVector_12; }
inline void set_backVector_12(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___backVector_12 = value;
}
inline static int32_t get_offset_of_positiveInfinityVector_13() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___positiveInfinityVector_13)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_positiveInfinityVector_13() const { return ___positiveInfinityVector_13; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_positiveInfinityVector_13() { return &___positiveInfinityVector_13; }
inline void set_positiveInfinityVector_13(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___positiveInfinityVector_13 = value;
}
inline static int32_t get_offset_of_negativeInfinityVector_14() { return static_cast<int32_t>(offsetof(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_StaticFields, ___negativeInfinityVector_14)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_negativeInfinityVector_14() const { return ___negativeInfinityVector_14; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_negativeInfinityVector_14() { return &___negativeInfinityVector_14; }
inline void set_negativeInfinityVector_14(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___negativeInfinityVector_14 = value;
}
};
// UnityEngine.CameraClearFlags
struct CameraClearFlags_tAC22BD22D12708CBDC63F6CFB31109E5E17CF239
{
public:
// System.Int32 UnityEngine.CameraClearFlags::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(CameraClearFlags_tAC22BD22D12708CBDC63F6CFB31109E5E17CF239, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// UnityEngine.Display
struct Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 : public RuntimeObject
{
public:
// System.IntPtr UnityEngine.Display::nativeDisplay
intptr_t ___nativeDisplay_0;
public:
inline static int32_t get_offset_of_nativeDisplay_0() { return static_cast<int32_t>(offsetof(Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57, ___nativeDisplay_0)); }
inline intptr_t get_nativeDisplay_0() const { return ___nativeDisplay_0; }
inline intptr_t* get_address_of_nativeDisplay_0() { return &___nativeDisplay_0; }
inline void set_nativeDisplay_0(intptr_t value)
{
___nativeDisplay_0 = value;
}
};
struct Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_StaticFields
{
public:
// UnityEngine.Display[] UnityEngine.Display::displays
DisplayU5BU5D_tB2AB0FDB3B2E9FD784D5100C18EB0ED489A2CCC9* ___displays_1;
// UnityEngine.Display UnityEngine.Display::_mainDisplay
Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 * ____mainDisplay_2;
// UnityEngine.Display/DisplaysUpdatedDelegate UnityEngine.Display::onDisplaysUpdated
DisplaysUpdatedDelegate_t2FAF995B47D691BD7C5BBC17D533DD8B19BE9A90 * ___onDisplaysUpdated_3;
public:
inline static int32_t get_offset_of_displays_1() { return static_cast<int32_t>(offsetof(Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_StaticFields, ___displays_1)); }
inline DisplayU5BU5D_tB2AB0FDB3B2E9FD784D5100C18EB0ED489A2CCC9* get_displays_1() const { return ___displays_1; }
inline DisplayU5BU5D_tB2AB0FDB3B2E9FD784D5100C18EB0ED489A2CCC9** get_address_of_displays_1() { return &___displays_1; }
inline void set_displays_1(DisplayU5BU5D_tB2AB0FDB3B2E9FD784D5100C18EB0ED489A2CCC9* value)
{
___displays_1 = value;
Il2CppCodeGenWriteBarrier((void**)(&___displays_1), (void*)value);
}
inline static int32_t get_offset_of__mainDisplay_2() { return static_cast<int32_t>(offsetof(Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_StaticFields, ____mainDisplay_2)); }
inline Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 * get__mainDisplay_2() const { return ____mainDisplay_2; }
inline Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 ** get_address_of__mainDisplay_2() { return &____mainDisplay_2; }
inline void set__mainDisplay_2(Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 * value)
{
____mainDisplay_2 = value;
Il2CppCodeGenWriteBarrier((void**)(&____mainDisplay_2), (void*)value);
}
inline static int32_t get_offset_of_onDisplaysUpdated_3() { return static_cast<int32_t>(offsetof(Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_StaticFields, ___onDisplaysUpdated_3)); }
inline DisplaysUpdatedDelegate_t2FAF995B47D691BD7C5BBC17D533DD8B19BE9A90 * get_onDisplaysUpdated_3() const { return ___onDisplaysUpdated_3; }
inline DisplaysUpdatedDelegate_t2FAF995B47D691BD7C5BBC17D533DD8B19BE9A90 ** get_address_of_onDisplaysUpdated_3() { return &___onDisplaysUpdated_3; }
inline void set_onDisplaysUpdated_3(DisplaysUpdatedDelegate_t2FAF995B47D691BD7C5BBC17D533DD8B19BE9A90 * value)
{
___onDisplaysUpdated_3 = value;
Il2CppCodeGenWriteBarrier((void**)(&___onDisplaysUpdated_3), (void*)value);
}
};
// UnityEngine.IMECompositionMode
struct IMECompositionMode_t491836CA4BD289253C9FF16B3C158744C8598CE2
{
public:
// System.Int32 UnityEngine.IMECompositionMode::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(IMECompositionMode_t491836CA4BD289253C9FF16B3C158744C8598CE2, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// UnityEngine.KeyCode
struct KeyCode_tC93EA87C5A6901160B583ADFCD3EF6726570DC3C
{
public:
// System.Int32 UnityEngine.KeyCode::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(KeyCode_tC93EA87C5A6901160B583ADFCD3EF6726570DC3C, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 : public RuntimeObject
{
public:
// System.IntPtr UnityEngine.Object::m_CachedPtr
intptr_t ___m_CachedPtr_0;
public:
inline static int32_t get_offset_of_m_CachedPtr_0() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0, ___m_CachedPtr_0)); }
inline intptr_t get_m_CachedPtr_0() const { return ___m_CachedPtr_0; }
inline intptr_t* get_address_of_m_CachedPtr_0() { return &___m_CachedPtr_0; }
inline void set_m_CachedPtr_0(intptr_t value)
{
___m_CachedPtr_0 = value;
}
};
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields
{
public:
// System.Int32 UnityEngine.Object::OffsetOfInstanceIDInCPlusPlusObject
int32_t ___OffsetOfInstanceIDInCPlusPlusObject_1;
public:
inline static int32_t get_offset_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return static_cast<int32_t>(offsetof(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_StaticFields, ___OffsetOfInstanceIDInCPlusPlusObject_1)); }
inline int32_t get_OffsetOfInstanceIDInCPlusPlusObject_1() const { return ___OffsetOfInstanceIDInCPlusPlusObject_1; }
inline int32_t* get_address_of_OffsetOfInstanceIDInCPlusPlusObject_1() { return &___OffsetOfInstanceIDInCPlusPlusObject_1; }
inline void set_OffsetOfInstanceIDInCPlusPlusObject_1(int32_t value)
{
___OffsetOfInstanceIDInCPlusPlusObject_1 = value;
}
};
// Native definition for P/Invoke marshalling of UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_pinvoke
{
intptr_t ___m_CachedPtr_0;
};
// Native definition for COM marshalling of UnityEngine.Object
struct Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_marshaled_com
{
intptr_t ___m_CachedPtr_0;
};
// UnityEngine.Ray
struct Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2
{
public:
// UnityEngine.Vector3 UnityEngine.Ray::m_Origin
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___m_Origin_0;
// UnityEngine.Vector3 UnityEngine.Ray::m_Direction
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___m_Direction_1;
public:
inline static int32_t get_offset_of_m_Origin_0() { return static_cast<int32_t>(offsetof(Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2, ___m_Origin_0)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_m_Origin_0() const { return ___m_Origin_0; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_m_Origin_0() { return &___m_Origin_0; }
inline void set_m_Origin_0(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___m_Origin_0 = value;
}
inline static int32_t get_offset_of_m_Direction_1() { return static_cast<int32_t>(offsetof(Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2, ___m_Direction_1)); }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 get_m_Direction_1() const { return ___m_Direction_1; }
inline Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * get_address_of_m_Direction_1() { return &___m_Direction_1; }
inline void set_m_Direction_1(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 value)
{
___m_Direction_1 = value;
}
};
// UnityEngine.SendMessageOptions
struct SendMessageOptions_t4EA4645A7D0C4E0186BD7A984CDF4EE2C8F26250
{
public:
// System.Int32 UnityEngine.SendMessageOptions::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(SendMessageOptions_t4EA4645A7D0C4E0186BD7A984CDF4EE2C8F26250, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// UnityEngine.TouchPhase
struct TouchPhase_t7E9CEC3DD059E32F847242513BD6CE30866AB2A6
{
public:
// System.Int32 UnityEngine.TouchPhase::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(TouchPhase_t7E9CEC3DD059E32F847242513BD6CE30866AB2A6, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// UnityEngine.TouchType
struct TouchType_tBBD83025576FC017B10484014B5C396613A02B8E
{
public:
// System.Int32 UnityEngine.TouchType::value__
int32_t ___value___2;
public:
inline static int32_t get_offset_of_value___2() { return static_cast<int32_t>(offsetof(TouchType_tBBD83025576FC017B10484014B5C396613A02B8E, ___value___2)); }
inline int32_t get_value___2() const { return ___value___2; }
inline int32_t* get_address_of_value___2() { return &___value___2; }
inline void set_value___2(int32_t value)
{
___value___2 = value;
}
};
// UnityEngine.Component
struct Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
public:
};
// UnityEngine.GameObject
struct GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
public:
};
// UnityEngine.Texture
struct Texture_t387FE83BB848001FD06B14707AEA6D5A0F6A95F4 : public Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0
{
public:
public:
};
struct Texture_t387FE83BB848001FD06B14707AEA6D5A0F6A95F4_StaticFields
{
public:
// System.Int32 UnityEngine.Texture::GenerateAllMips
int32_t ___GenerateAllMips_4;
public:
inline static int32_t get_offset_of_GenerateAllMips_4() { return static_cast<int32_t>(offsetof(Texture_t387FE83BB848001FD06B14707AEA6D5A0F6A95F4_StaticFields, ___GenerateAllMips_4)); }
inline int32_t get_GenerateAllMips_4() const { return ___GenerateAllMips_4; }
inline int32_t* get_address_of_GenerateAllMips_4() { return &___GenerateAllMips_4; }
inline void set_GenerateAllMips_4(int32_t value)
{
___GenerateAllMips_4 = value;
}
};
// UnityEngine.Touch
struct Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8
{
public:
// System.Int32 UnityEngine.Touch::m_FingerId
int32_t ___m_FingerId_0;
// UnityEngine.Vector2 UnityEngine.Touch::m_Position
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___m_Position_1;
// UnityEngine.Vector2 UnityEngine.Touch::m_RawPosition
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___m_RawPosition_2;
// UnityEngine.Vector2 UnityEngine.Touch::m_PositionDelta
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___m_PositionDelta_3;
// System.Single UnityEngine.Touch::m_TimeDelta
float ___m_TimeDelta_4;
// System.Int32 UnityEngine.Touch::m_TapCount
int32_t ___m_TapCount_5;
// UnityEngine.TouchPhase UnityEngine.Touch::m_Phase
int32_t ___m_Phase_6;
// UnityEngine.TouchType UnityEngine.Touch::m_Type
int32_t ___m_Type_7;
// System.Single UnityEngine.Touch::m_Pressure
float ___m_Pressure_8;
// System.Single UnityEngine.Touch::m_maximumPossiblePressure
float ___m_maximumPossiblePressure_9;
// System.Single UnityEngine.Touch::m_Radius
float ___m_Radius_10;
// System.Single UnityEngine.Touch::m_RadiusVariance
float ___m_RadiusVariance_11;
// System.Single UnityEngine.Touch::m_AltitudeAngle
float ___m_AltitudeAngle_12;
// System.Single UnityEngine.Touch::m_AzimuthAngle
float ___m_AzimuthAngle_13;
public:
inline static int32_t get_offset_of_m_FingerId_0() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_FingerId_0)); }
inline int32_t get_m_FingerId_0() const { return ___m_FingerId_0; }
inline int32_t* get_address_of_m_FingerId_0() { return &___m_FingerId_0; }
inline void set_m_FingerId_0(int32_t value)
{
___m_FingerId_0 = value;
}
inline static int32_t get_offset_of_m_Position_1() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_Position_1)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_m_Position_1() const { return ___m_Position_1; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_m_Position_1() { return &___m_Position_1; }
inline void set_m_Position_1(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___m_Position_1 = value;
}
inline static int32_t get_offset_of_m_RawPosition_2() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_RawPosition_2)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_m_RawPosition_2() const { return ___m_RawPosition_2; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_m_RawPosition_2() { return &___m_RawPosition_2; }
inline void set_m_RawPosition_2(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___m_RawPosition_2 = value;
}
inline static int32_t get_offset_of_m_PositionDelta_3() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_PositionDelta_3)); }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D get_m_PositionDelta_3() const { return ___m_PositionDelta_3; }
inline Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * get_address_of_m_PositionDelta_3() { return &___m_PositionDelta_3; }
inline void set_m_PositionDelta_3(Vector2_tA85D2DD88578276CA8A8796756458277E72D073D value)
{
___m_PositionDelta_3 = value;
}
inline static int32_t get_offset_of_m_TimeDelta_4() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_TimeDelta_4)); }
inline float get_m_TimeDelta_4() const { return ___m_TimeDelta_4; }
inline float* get_address_of_m_TimeDelta_4() { return &___m_TimeDelta_4; }
inline void set_m_TimeDelta_4(float value)
{
___m_TimeDelta_4 = value;
}
inline static int32_t get_offset_of_m_TapCount_5() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_TapCount_5)); }
inline int32_t get_m_TapCount_5() const { return ___m_TapCount_5; }
inline int32_t* get_address_of_m_TapCount_5() { return &___m_TapCount_5; }
inline void set_m_TapCount_5(int32_t value)
{
___m_TapCount_5 = value;
}
inline static int32_t get_offset_of_m_Phase_6() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_Phase_6)); }
inline int32_t get_m_Phase_6() const { return ___m_Phase_6; }
inline int32_t* get_address_of_m_Phase_6() { return &___m_Phase_6; }
inline void set_m_Phase_6(int32_t value)
{
___m_Phase_6 = value;
}
inline static int32_t get_offset_of_m_Type_7() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_Type_7)); }
inline int32_t get_m_Type_7() const { return ___m_Type_7; }
inline int32_t* get_address_of_m_Type_7() { return &___m_Type_7; }
inline void set_m_Type_7(int32_t value)
{
___m_Type_7 = value;
}
inline static int32_t get_offset_of_m_Pressure_8() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_Pressure_8)); }
inline float get_m_Pressure_8() const { return ___m_Pressure_8; }
inline float* get_address_of_m_Pressure_8() { return &___m_Pressure_8; }
inline void set_m_Pressure_8(float value)
{
___m_Pressure_8 = value;
}
inline static int32_t get_offset_of_m_maximumPossiblePressure_9() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_maximumPossiblePressure_9)); }
inline float get_m_maximumPossiblePressure_9() const { return ___m_maximumPossiblePressure_9; }
inline float* get_address_of_m_maximumPossiblePressure_9() { return &___m_maximumPossiblePressure_9; }
inline void set_m_maximumPossiblePressure_9(float value)
{
___m_maximumPossiblePressure_9 = value;
}
inline static int32_t get_offset_of_m_Radius_10() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_Radius_10)); }
inline float get_m_Radius_10() const { return ___m_Radius_10; }
inline float* get_address_of_m_Radius_10() { return &___m_Radius_10; }
inline void set_m_Radius_10(float value)
{
___m_Radius_10 = value;
}
inline static int32_t get_offset_of_m_RadiusVariance_11() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_RadiusVariance_11)); }
inline float get_m_RadiusVariance_11() const { return ___m_RadiusVariance_11; }
inline float* get_address_of_m_RadiusVariance_11() { return &___m_RadiusVariance_11; }
inline void set_m_RadiusVariance_11(float value)
{
___m_RadiusVariance_11 = value;
}
inline static int32_t get_offset_of_m_AltitudeAngle_12() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_AltitudeAngle_12)); }
inline float get_m_AltitudeAngle_12() const { return ___m_AltitudeAngle_12; }
inline float* get_address_of_m_AltitudeAngle_12() { return &___m_AltitudeAngle_12; }
inline void set_m_AltitudeAngle_12(float value)
{
___m_AltitudeAngle_12 = value;
}
inline static int32_t get_offset_of_m_AzimuthAngle_13() { return static_cast<int32_t>(offsetof(Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8, ___m_AzimuthAngle_13)); }
inline float get_m_AzimuthAngle_13() const { return ___m_AzimuthAngle_13; }
inline float* get_address_of_m_AzimuthAngle_13() { return &___m_AzimuthAngle_13; }
inline void set_m_AzimuthAngle_13(float value)
{
___m_AzimuthAngle_13 = value;
}
};
// UnityEngine.Behaviour
struct Behaviour_tBDC7E9C3C898AD8348891B82D3E345801D920CA8 : public Component_t05064EF382ABCAF4B8C94F8A350EA85184C26621
{
public:
public:
};
// UnityEngine.RenderTexture
struct RenderTexture_tBC47D853E3DA6511CD6C49DBF78D47B890FCD2F6 : public Texture_t387FE83BB848001FD06B14707AEA6D5A0F6A95F4
{
public:
public:
};
// UnityEngine.Camera
struct Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 : public Behaviour_tBDC7E9C3C898AD8348891B82D3E345801D920CA8
{
public:
public:
};
struct Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34_StaticFields
{
public:
// UnityEngine.Camera/CameraCallback UnityEngine.Camera::onPreCull
CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0 * ___onPreCull_4;
// UnityEngine.Camera/CameraCallback UnityEngine.Camera::onPreRender
CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0 * ___onPreRender_5;
// UnityEngine.Camera/CameraCallback UnityEngine.Camera::onPostRender
CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0 * ___onPostRender_6;
public:
inline static int32_t get_offset_of_onPreCull_4() { return static_cast<int32_t>(offsetof(Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34_StaticFields, ___onPreCull_4)); }
inline CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0 * get_onPreCull_4() const { return ___onPreCull_4; }
inline CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0 ** get_address_of_onPreCull_4() { return &___onPreCull_4; }
inline void set_onPreCull_4(CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0 * value)
{
___onPreCull_4 = value;
Il2CppCodeGenWriteBarrier((void**)(&___onPreCull_4), (void*)value);
}
inline static int32_t get_offset_of_onPreRender_5() { return static_cast<int32_t>(offsetof(Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34_StaticFields, ___onPreRender_5)); }
inline CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0 * get_onPreRender_5() const { return ___onPreRender_5; }
inline CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0 ** get_address_of_onPreRender_5() { return &___onPreRender_5; }
inline void set_onPreRender_5(CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0 * value)
{
___onPreRender_5 = value;
Il2CppCodeGenWriteBarrier((void**)(&___onPreRender_5), (void*)value);
}
inline static int32_t get_offset_of_onPostRender_6() { return static_cast<int32_t>(offsetof(Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34_StaticFields, ___onPostRender_6)); }
inline CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0 * get_onPostRender_6() const { return ___onPostRender_6; }
inline CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0 ** get_address_of_onPostRender_6() { return &___onPostRender_6; }
inline void set_onPostRender_6(CameraCallback_t8BBB42AA08D7498DFC11F4128117055BC7F0B9D0 * value)
{
___onPostRender_6 = value;
Il2CppCodeGenWriteBarrier((void**)(&___onPostRender_6), (void*)value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
// UnityEngine.Camera[]
struct CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9 : public RuntimeArray
{
public:
ALIGN_FIELD (8) Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * m_Items[1];
public:
inline Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * GetAt(il2cpp_array_size_t index) const
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items[index];
}
inline Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 ** GetAddressAt(il2cpp_array_size_t index)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items + index;
}
inline void SetAt(il2cpp_array_size_t index, Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * value)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
m_Items[index] = value;
Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value);
}
inline Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * GetAtUnchecked(il2cpp_array_size_t index) const
{
return m_Items[index];
}
inline Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 ** GetAddressAtUnchecked(il2cpp_array_size_t index)
{
return m_Items + index;
}
inline void SetAtUnchecked(il2cpp_array_size_t index, Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * value)
{
m_Items[index] = value;
Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value);
}
};
// UnityEngine.SendMouseEvents/HitInfo[]
struct HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1 : public RuntimeArray
{
public:
ALIGN_FIELD (8) HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 m_Items[1];
public:
inline HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 GetAt(il2cpp_array_size_t index) const
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items[index];
}
inline HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 * GetAddressAt(il2cpp_array_size_t index)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items + index;
}
inline void SetAt(il2cpp_array_size_t index, HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 value)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
m_Items[index] = value;
Il2CppCodeGenWriteBarrier((void**)&((m_Items + index)->___target_0), (void*)NULL);
#if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS
Il2CppCodeGenWriteBarrier((void**)&((m_Items + index)->___camera_1), (void*)NULL);
#endif
}
inline HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 GetAtUnchecked(il2cpp_array_size_t index) const
{
return m_Items[index];
}
inline HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 * GetAddressAtUnchecked(il2cpp_array_size_t index)
{
return m_Items + index;
}
inline void SetAtUnchecked(il2cpp_array_size_t index, HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 value)
{
m_Items[index] = value;
Il2CppCodeGenWriteBarrier((void**)&((m_Items + index)->___target_0), (void*)NULL);
#if IL2CPP_ENABLE_STRICT_WRITE_BARRIERS
Il2CppCodeGenWriteBarrier((void**)&((m_Items + index)->___camera_1), (void*)NULL);
#endif
}
};
// UnityEngine.Display[]
struct DisplayU5BU5D_tB2AB0FDB3B2E9FD784D5100C18EB0ED489A2CCC9 : public RuntimeArray
{
public:
ALIGN_FIELD (8) Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 * m_Items[1];
public:
inline Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 * GetAt(il2cpp_array_size_t index) const
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items[index];
}
inline Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 ** GetAddressAt(il2cpp_array_size_t index)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
return m_Items + index;
}
inline void SetAt(il2cpp_array_size_t index, Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 * value)
{
IL2CPP_ARRAY_BOUNDS_CHECK(index, (uint32_t)(this)->max_length);
m_Items[index] = value;
Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value);
}
inline Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 * GetAtUnchecked(il2cpp_array_size_t index) const
{
return m_Items[index];
}
inline Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 ** GetAddressAtUnchecked(il2cpp_array_size_t index)
{
return m_Items + index;
}
inline void SetAtUnchecked(il2cpp_array_size_t index, Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 * value)
{
m_Items[index] = value;
Il2CppCodeGenWriteBarrier((void**)m_Items + index, (void*)value);
}
};
// UnityEngine.GameObject UnityEngine.CameraRaycastHelper::RaycastTry_Injected(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * CameraRaycastHelper_RaycastTry_Injected_m2326FE94A96F40A5D51E4261E68C5E42B914D894 (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * ___cam0, Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 * ___ray1, float ___distance2, int32_t ___layerMask3, const RuntimeMethod* method);
// UnityEngine.GameObject UnityEngine.CameraRaycastHelper::RaycastTry2D_Injected(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * CameraRaycastHelper_RaycastTry2D_Injected_m287E51B2B7D2F6D14B400A6EEA90FF6F83CF5F62 (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * ___cam0, Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 * ___ray1, float ___distance2, int32_t ___layerMask3, const RuntimeMethod* method);
// System.Void UnityEngine.Input::GetTouch_Injected(System.Int32,UnityEngine.Touch&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Input_GetTouch_Injected_mDD8AC74C22DC466C6CC45C46A2089FCF5F4F5CFB (int32_t ___index0, Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * ___ret1, const RuntimeMethod* method);
// System.Boolean UnityEngine.Input::GetKeyInt(UnityEngine.KeyCode)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetKeyInt_mD9867F6FBC8BDCA7D7C82E56471B5C841A9BEB65 (int32_t ___key0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Input::GetKeyUpInt(UnityEngine.KeyCode)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetKeyUpInt_m8BEA98822582BABA67D68571EB63B030868EA9FE (int32_t ___key0, const RuntimeMethod* method);
// System.Void UnityEngine.Input::get_mousePosition_Injected(UnityEngine.Vector3&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Input_get_mousePosition_Injected_m16BF01CA8D64169CE48F8EA804A3F25832316B63 (Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * ___ret0, const RuntimeMethod* method);
// System.Void UnityEngine.Input::get_mouseScrollDelta_Injected(UnityEngine.Vector2&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Input_get_mouseScrollDelta_Injected_mB4D24BDB2FEAA16E6AEBE2383783AFA00463945B (Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * ___ret0, const RuntimeMethod* method);
// System.Void UnityEngine.Input::get_compositionCursorPos_Injected(UnityEngine.Vector2&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Input_get_compositionCursorPos_Injected_m513709187290CBEF2788BA0B61B7D5A056731195 (Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * ___ret0, const RuntimeMethod* method);
// System.Void UnityEngine.Input::set_compositionCursorPos_Injected(UnityEngine.Vector2&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Input_set_compositionCursorPos_Injected_mFED26C8FCDE955B227669C9023108D41E65766E1 (Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * ___value0, const RuntimeMethod* method);
// UnityEngine.Vector3 UnityEngine.Input::get_mousePosition()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 Input_get_mousePosition_m1F6706785983B41FE8D5CBB81B5F15F68EBD9A53 (const RuntimeMethod* method);
// System.Int32 UnityEngine.Camera::get_allCamerasCount()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Camera_get_allCamerasCount_mF6CDC46D6F61B1F1A0337A9AD7DFA485E408E6A1 (const RuntimeMethod* method);
// System.Int32 UnityEngine.Camera::GetAllCameras(UnityEngine.Camera[])
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Camera_GetAllCameras_m500A4F27E7BE1C259E9EAA0AEBB1E1B35893059C (CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* ___cameras0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Object::op_Equality(UnityEngine.Object,UnityEngine.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___x0, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___y1, const RuntimeMethod* method);
// UnityEngine.RenderTexture UnityEngine.Camera::get_targetTexture()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR RenderTexture_tBC47D853E3DA6511CD6C49DBF78D47B890FCD2F6 * Camera_get_targetTexture_m1E776560FAC888D8210D49CEE310BB39D34A3FDC (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Object::op_Inequality(UnityEngine.Object,UnityEngine.Object)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1 (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___x0, Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 * ___y1, const RuntimeMethod* method);
// System.Int32 UnityEngine.Camera::get_targetDisplay()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Camera_get_targetDisplay_m2C318D2EB9A016FEC76B13F7F7AE382F443FB731 (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * __this, const RuntimeMethod* method);
// UnityEngine.Vector3 UnityEngine.Display::RelativeMouseAt(UnityEngine.Vector3)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 Display_RelativeMouseAt_mABDA4BAC2C1B328A2C6A205D552AA5488BFFAA93 (Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___inputMouseCoordinates0, const RuntimeMethod* method);
// UnityEngine.Vector3 UnityEngine.Vector3::get_zero()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 Vector3_get_zero_m3CDDCAE94581DF3BB16C4B40A100E28E9C6649C2 (const RuntimeMethod* method);
// System.Boolean UnityEngine.Vector3::op_Inequality(UnityEngine.Vector3,UnityEngine.Vector3)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Vector3_op_Inequality_mFEEAA4C4BF743FB5B8A47FF4967A5E2C73273D6E (Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___lhs0, Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___rhs1, const RuntimeMethod* method);
// System.Int32 UnityEngine.Screen::get_width()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Screen_get_width_m8ECCEF7FF17395D1237BC0193D7A6640A3FEEAD3 (const RuntimeMethod* method);
// System.Int32 UnityEngine.Screen::get_height()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Screen_get_height_mF5B64EBC4CDE0EAAA5713C1452ED2CE475F25150 (const RuntimeMethod* method);
// System.Int32 UnityEngine.Display::get_systemWidth()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Display_get_systemWidth_mA14AF2D3B017CF4BA2C2990DC2398E528AF83413 (Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 * __this, const RuntimeMethod* method);
// System.Int32 UnityEngine.Display::get_systemHeight()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Display_get_systemHeight_m0D7950CB39015167C175634EF8A5E0C52FBF5EC7 (Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 * __this, const RuntimeMethod* method);
// System.Void UnityEngine.Vector2::.ctor(System.Single,System.Single)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Vector2__ctor_mEE8FB117AB1F8DB746FB8B3EB4C0DA3BF2A230D0 (Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * __this, float ___x0, float ___y1, const RuntimeMethod* method);
// UnityEngine.Rect UnityEngine.Camera::get_pixelRect()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Rect_t35B976DE901B5423C11705E156938EA27AB402CE Camera_get_pixelRect_mBA87D6C23FD7A5E1A7F3CE0E8F9B86A9318B5317 (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Rect::Contains(UnityEngine.Vector3)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Rect_Contains_m5072228CE6251E7C754F227BA330F9ADA95C1495 (Rect_t35B976DE901B5423C11705E156938EA27AB402CE * __this, Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___point0, const RuntimeMethod* method);
// System.Int32 UnityEngine.Camera::get_eventMask()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Camera_get_eventMask_m1D85900090AF34244340C69B53A42CDE5E9669D3 (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * __this, const RuntimeMethod* method);
// UnityEngine.Ray UnityEngine.Camera::ScreenPointToRay(UnityEngine.Vector3)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 Camera_ScreenPointToRay_m27638E78502DB6D6D7113F81AF7C210773B828F3 (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * __this, Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 ___pos0, const RuntimeMethod* method);
// UnityEngine.Vector3 UnityEngine.Ray::get_direction()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 Ray_get_direction_m9E6468CD87844B437FC4B93491E63D388322F76E (Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 * __this, const RuntimeMethod* method);
// System.Boolean UnityEngine.Mathf::Approximately(System.Single,System.Single)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E (float ___a0, float ___b1, const RuntimeMethod* method);
// System.Single UnityEngine.Camera::get_farClipPlane()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR float Camera_get_farClipPlane_mF51F1FF5BE87719CFAC293E272B1138DC1EFFD4B (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * __this, const RuntimeMethod* method);
// System.Single UnityEngine.Camera::get_nearClipPlane()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR float Camera_get_nearClipPlane_mD9D3E3D27186BBAC2CC354CE3609E6118A5BF66C (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * __this, const RuntimeMethod* method);
// System.Int32 UnityEngine.Camera::get_cullingMask()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Camera_get_cullingMask_m0992E96D87A4221E38746EBD882780CEFF7C2BCD (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * __this, const RuntimeMethod* method);
// UnityEngine.GameObject UnityEngine.CameraRaycastHelper::RaycastTry(UnityEngine.Camera,UnityEngine.Ray,System.Single,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * CameraRaycastHelper_RaycastTry_m6E6369E18DAA7CA518D8B826E1030FFBDAA79B95 (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * ___cam0, Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 ___ray1, float ___distance2, int32_t ___layerMask3, const RuntimeMethod* method);
// UnityEngine.CameraClearFlags UnityEngine.Camera::get_clearFlags()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Camera_get_clearFlags_m1D02BA1ABD7310269F6121C58AF41DCDEF1E0266 (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * __this, const RuntimeMethod* method);
// UnityEngine.GameObject UnityEngine.CameraRaycastHelper::RaycastTry2D(UnityEngine.Camera,UnityEngine.Ray,System.Single,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * CameraRaycastHelper_RaycastTry2D_mE4F905B8FC0FC471EB8DDF2F3B8A7C2B9E54CEDE (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * ___cam0, Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 ___ray1, float ___distance2, int32_t ___layerMask3, const RuntimeMethod* method);
// System.Void UnityEngine.SendMouseEvents::SendEvents(System.Int32,UnityEngine.SendMouseEvents/HitInfo)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void SendMouseEvents_SendEvents_m2E266CFBE23F89BA8563312C8488DF1E9A7C25F0 (int32_t ___i0, HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 ___hit1, const RuntimeMethod* method);
// System.Boolean UnityEngine.Input::GetMouseButtonDown(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetMouseButtonDown_m5AD76E22AA839706219AD86A4E0BE5276AF8E28A (int32_t ___button0, const RuntimeMethod* method);
// System.Boolean UnityEngine.Input::GetMouseButton(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetMouseButton_m43C68DE93C7D990E875BA53C4DEC9CA6230C8B79 (int32_t ___button0, const RuntimeMethod* method);
// System.Boolean UnityEngine.SendMouseEvents/HitInfo::op_Implicit(UnityEngine.SendMouseEvents/HitInfo)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool HitInfo_op_Implicit_mBB6DB77D68B22445EC255E34E7EE7667FD584322 (HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 ___exists0, const RuntimeMethod* method);
// System.Void UnityEngine.SendMouseEvents/HitInfo::SendMessage(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void HitInfo_SendMessage_m03D1D4402F97AA2D7E4A1D8A8C18A313B5DE6434 (HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 * __this, String_t* ___name0, const RuntimeMethod* method);
// System.Boolean UnityEngine.SendMouseEvents/HitInfo::Compare(UnityEngine.SendMouseEvents/HitInfo,UnityEngine.SendMouseEvents/HitInfo)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool HitInfo_Compare_m5643F7A11E2F60B86286330548DF614BD9691582 (HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 ___lhs0, HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 ___rhs1, const RuntimeMethod* method);
// System.Void UnityEngine.GameObject::SendMessage(System.String,System.Object,UnityEngine.SendMessageOptions)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void GameObject_SendMessage_mB9147E503F1F55C4F3BC2816C0BDA8C21EA22E95 (GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * __this, String_t* ___methodName0, RuntimeObject * ___value1, int32_t ___options2, const RuntimeMethod* method);
// System.Int32 UnityEngine.Touch::get_fingerId()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Touch_get_fingerId_m2EF0EF2E6E388C8D9D38C58EF5D03EA30E568E1D (Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * __this, const RuntimeMethod* method);
// UnityEngine.Vector2 UnityEngine.Touch::get_position()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector2_tA85D2DD88578276CA8A8796756458277E72D073D Touch_get_position_m2E60676112DA3628CF2DC76418A275C7FE521D8F (Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * __this, const RuntimeMethod* method);
// UnityEngine.TouchPhase UnityEngine.Touch::get_phase()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Touch_get_phase_m759A61477ECBBD90A57E36F1166EB9340A0FE349 (Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * __this, const RuntimeMethod* method);
// UnityEngine.TouchType UnityEngine.Touch::get_type()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Touch_get_type_mAF919D12756ABA000A17146E82FDDFCEBFD6EEA9 (Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * __this, const RuntimeMethod* method);
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// UnityEngine.GameObject UnityEngine.CameraRaycastHelper::RaycastTry(UnityEngine.Camera,UnityEngine.Ray,System.Single,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * CameraRaycastHelper_RaycastTry_m6E6369E18DAA7CA518D8B826E1030FFBDAA79B95 (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * ___cam0, Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 ___ray1, float ___distance2, int32_t ___layerMask3, const RuntimeMethod* method)
{
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_0 = ___cam0;
float L_1 = ___distance2;
int32_t L_2 = ___layerMask3;
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_3 = CameraRaycastHelper_RaycastTry_Injected_m2326FE94A96F40A5D51E4261E68C5E42B914D894(L_0, (Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 *)(&___ray1), L_1, L_2, /*hidden argument*/NULL);
return L_3;
}
}
// UnityEngine.GameObject UnityEngine.CameraRaycastHelper::RaycastTry2D(UnityEngine.Camera,UnityEngine.Ray,System.Single,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * CameraRaycastHelper_RaycastTry2D_mE4F905B8FC0FC471EB8DDF2F3B8A7C2B9E54CEDE (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * ___cam0, Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 ___ray1, float ___distance2, int32_t ___layerMask3, const RuntimeMethod* method)
{
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_0 = ___cam0;
float L_1 = ___distance2;
int32_t L_2 = ___layerMask3;
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_3 = CameraRaycastHelper_RaycastTry2D_Injected_m287E51B2B7D2F6D14B400A6EEA90FF6F83CF5F62(L_0, (Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 *)(&___ray1), L_1, L_2, /*hidden argument*/NULL);
return L_3;
}
}
// UnityEngine.GameObject UnityEngine.CameraRaycastHelper::RaycastTry_Injected(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * CameraRaycastHelper_RaycastTry_Injected_m2326FE94A96F40A5D51E4261E68C5E42B914D894 (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * ___cam0, Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 * ___ray1, float ___distance2, int32_t ___layerMask3, const RuntimeMethod* method)
{
typedef GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * (*CameraRaycastHelper_RaycastTry_Injected_m2326FE94A96F40A5D51E4261E68C5E42B914D894_ftn) (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 *, Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 *, float, int32_t);
static CameraRaycastHelper_RaycastTry_Injected_m2326FE94A96F40A5D51E4261E68C5E42B914D894_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (CameraRaycastHelper_RaycastTry_Injected_m2326FE94A96F40A5D51E4261E68C5E42B914D894_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CameraRaycastHelper::RaycastTry_Injected(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32)");
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * retVal = _il2cpp_icall_func(___cam0, ___ray1, ___distance2, ___layerMask3);
return retVal;
}
// UnityEngine.GameObject UnityEngine.CameraRaycastHelper::RaycastTry2D_Injected(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * CameraRaycastHelper_RaycastTry2D_Injected_m287E51B2B7D2F6D14B400A6EEA90FF6F83CF5F62 (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * ___cam0, Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 * ___ray1, float ___distance2, int32_t ___layerMask3, const RuntimeMethod* method)
{
typedef GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * (*CameraRaycastHelper_RaycastTry2D_Injected_m287E51B2B7D2F6D14B400A6EEA90FF6F83CF5F62_ftn) (Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 *, Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 *, float, int32_t);
static CameraRaycastHelper_RaycastTry2D_Injected_m287E51B2B7D2F6D14B400A6EEA90FF6F83CF5F62_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (CameraRaycastHelper_RaycastTry2D_Injected_m287E51B2B7D2F6D14B400A6EEA90FF6F83CF5F62_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.CameraRaycastHelper::RaycastTry2D_Injected(UnityEngine.Camera,UnityEngine.Ray&,System.Single,System.Int32)");
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * retVal = _il2cpp_icall_func(___cam0, ___ray1, ___distance2, ___layerMask3);
return retVal;
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Boolean UnityEngine.Input::GetKeyInt(UnityEngine.KeyCode)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetKeyInt_mD9867F6FBC8BDCA7D7C82E56471B5C841A9BEB65 (int32_t ___key0, const RuntimeMethod* method)
{
typedef bool (*Input_GetKeyInt_mD9867F6FBC8BDCA7D7C82E56471B5C841A9BEB65_ftn) (int32_t);
static Input_GetKeyInt_mD9867F6FBC8BDCA7D7C82E56471B5C841A9BEB65_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_GetKeyInt_mD9867F6FBC8BDCA7D7C82E56471B5C841A9BEB65_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::GetKeyInt(UnityEngine.KeyCode)");
bool retVal = _il2cpp_icall_func(___key0);
return retVal;
}
// System.Boolean UnityEngine.Input::GetKeyUpInt(UnityEngine.KeyCode)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetKeyUpInt_m8BEA98822582BABA67D68571EB63B030868EA9FE (int32_t ___key0, const RuntimeMethod* method)
{
typedef bool (*Input_GetKeyUpInt_m8BEA98822582BABA67D68571EB63B030868EA9FE_ftn) (int32_t);
static Input_GetKeyUpInt_m8BEA98822582BABA67D68571EB63B030868EA9FE_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_GetKeyUpInt_m8BEA98822582BABA67D68571EB63B030868EA9FE_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::GetKeyUpInt(UnityEngine.KeyCode)");
bool retVal = _il2cpp_icall_func(___key0);
return retVal;
}
// System.Single UnityEngine.Input::GetAxis(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR float Input_GetAxis_m6454498C755B9A2C964875927FB557CA9E75D387 (String_t* ___axisName0, const RuntimeMethod* method)
{
typedef float (*Input_GetAxis_m6454498C755B9A2C964875927FB557CA9E75D387_ftn) (String_t*);
static Input_GetAxis_m6454498C755B9A2C964875927FB557CA9E75D387_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_GetAxis_m6454498C755B9A2C964875927FB557CA9E75D387_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::GetAxis(System.String)");
float retVal = _il2cpp_icall_func(___axisName0);
return retVal;
}
// System.Single UnityEngine.Input::GetAxisRaw(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR float Input_GetAxisRaw_mC68301A9D93702F0C393E45C6337348062EACE21 (String_t* ___axisName0, const RuntimeMethod* method)
{
typedef float (*Input_GetAxisRaw_mC68301A9D93702F0C393E45C6337348062EACE21_ftn) (String_t*);
static Input_GetAxisRaw_mC68301A9D93702F0C393E45C6337348062EACE21_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_GetAxisRaw_mC68301A9D93702F0C393E45C6337348062EACE21_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::GetAxisRaw(System.String)");
float retVal = _il2cpp_icall_func(___axisName0);
return retVal;
}
// System.Boolean UnityEngine.Input::GetButtonDown(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetButtonDown_m1E80BAC5CCBE9E0151491B8F8F5FFD6AB050BBF0 (String_t* ___buttonName0, const RuntimeMethod* method)
{
typedef bool (*Input_GetButtonDown_m1E80BAC5CCBE9E0151491B8F8F5FFD6AB050BBF0_ftn) (String_t*);
static Input_GetButtonDown_m1E80BAC5CCBE9E0151491B8F8F5FFD6AB050BBF0_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_GetButtonDown_m1E80BAC5CCBE9E0151491B8F8F5FFD6AB050BBF0_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::GetButtonDown(System.String)");
bool retVal = _il2cpp_icall_func(___buttonName0);
return retVal;
}
// System.Boolean UnityEngine.Input::GetButtonUp(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetButtonUp_m7AA360E8D19CAA86BF5623089968D2D63CFF74BB (String_t* ___buttonName0, const RuntimeMethod* method)
{
typedef bool (*Input_GetButtonUp_m7AA360E8D19CAA86BF5623089968D2D63CFF74BB_ftn) (String_t*);
static Input_GetButtonUp_m7AA360E8D19CAA86BF5623089968D2D63CFF74BB_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_GetButtonUp_m7AA360E8D19CAA86BF5623089968D2D63CFF74BB_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::GetButtonUp(System.String)");
bool retVal = _il2cpp_icall_func(___buttonName0);
return retVal;
}
// System.Boolean UnityEngine.Input::GetMouseButton(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetMouseButton_m43C68DE93C7D990E875BA53C4DEC9CA6230C8B79 (int32_t ___button0, const RuntimeMethod* method)
{
typedef bool (*Input_GetMouseButton_m43C68DE93C7D990E875BA53C4DEC9CA6230C8B79_ftn) (int32_t);
static Input_GetMouseButton_m43C68DE93C7D990E875BA53C4DEC9CA6230C8B79_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_GetMouseButton_m43C68DE93C7D990E875BA53C4DEC9CA6230C8B79_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::GetMouseButton(System.Int32)");
bool retVal = _il2cpp_icall_func(___button0);
return retVal;
}
// System.Boolean UnityEngine.Input::GetMouseButtonDown(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetMouseButtonDown_m5AD76E22AA839706219AD86A4E0BE5276AF8E28A (int32_t ___button0, const RuntimeMethod* method)
{
typedef bool (*Input_GetMouseButtonDown_m5AD76E22AA839706219AD86A4E0BE5276AF8E28A_ftn) (int32_t);
static Input_GetMouseButtonDown_m5AD76E22AA839706219AD86A4E0BE5276AF8E28A_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_GetMouseButtonDown_m5AD76E22AA839706219AD86A4E0BE5276AF8E28A_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::GetMouseButtonDown(System.Int32)");
bool retVal = _il2cpp_icall_func(___button0);
return retVal;
}
// System.Boolean UnityEngine.Input::GetMouseButtonUp(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetMouseButtonUp_m4899272EB31D43EC4A3A1A115843CD3D9AA2C4EC (int32_t ___button0, const RuntimeMethod* method)
{
typedef bool (*Input_GetMouseButtonUp_m4899272EB31D43EC4A3A1A115843CD3D9AA2C4EC_ftn) (int32_t);
static Input_GetMouseButtonUp_m4899272EB31D43EC4A3A1A115843CD3D9AA2C4EC_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_GetMouseButtonUp_m4899272EB31D43EC4A3A1A115843CD3D9AA2C4EC_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::GetMouseButtonUp(System.Int32)");
bool retVal = _il2cpp_icall_func(___button0);
return retVal;
}
// UnityEngine.Touch UnityEngine.Input::GetTouch(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 Input_GetTouch_m8082D8EE3A187488373CE6AC66A70B0AAD7CC23F (int32_t ___index0, const RuntimeMethod* method)
{
Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 V_0;
memset((&V_0), 0, sizeof(V_0));
{
int32_t L_0 = ___index0;
Input_GetTouch_Injected_mDD8AC74C22DC466C6CC45C46A2089FCF5F4F5CFB(L_0, (Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 *)(&V_0), /*hidden argument*/NULL);
Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 L_1 = V_0;
return L_1;
}
}
// System.Boolean UnityEngine.Input::GetKey(UnityEngine.KeyCode)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetKey_m46AA83E14F9C3A75E06FE0A8C55740D47B2DB784 (int32_t ___key0, const RuntimeMethod* method)
{
bool V_0 = false;
{
int32_t L_0 = ___key0;
bool L_1 = Input_GetKeyInt_mD9867F6FBC8BDCA7D7C82E56471B5C841A9BEB65(L_0, /*hidden argument*/NULL);
V_0 = L_1;
goto IL_000a;
}
IL_000a:
{
bool L_2 = V_0;
return L_2;
}
}
// System.Boolean UnityEngine.Input::GetKeyUp(UnityEngine.KeyCode)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_GetKeyUp_m5345ECFA25B7AC99D6D4223DA23BB9FB991B7193 (int32_t ___key0, const RuntimeMethod* method)
{
bool V_0 = false;
{
int32_t L_0 = ___key0;
bool L_1 = Input_GetKeyUpInt_m8BEA98822582BABA67D68571EB63B030868EA9FE(L_0, /*hidden argument*/NULL);
V_0 = L_1;
goto IL_000a;
}
IL_000a:
{
bool L_2 = V_0;
return L_2;
}
}
// UnityEngine.Vector3 UnityEngine.Input::get_mousePosition()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 Input_get_mousePosition_m1F6706785983B41FE8D5CBB81B5F15F68EBD9A53 (const RuntimeMethod* method)
{
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 V_0;
memset((&V_0), 0, sizeof(V_0));
{
Input_get_mousePosition_Injected_m16BF01CA8D64169CE48F8EA804A3F25832316B63((Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 *)(&V_0), /*hidden argument*/NULL);
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_0 = V_0;
return L_0;
}
}
// UnityEngine.Vector2 UnityEngine.Input::get_mouseScrollDelta()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector2_tA85D2DD88578276CA8A8796756458277E72D073D Input_get_mouseScrollDelta_m66F785090C429CE7DCDEF09C92CDBDD08FCDE98D (const RuntimeMethod* method)
{
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D V_0;
memset((&V_0), 0, sizeof(V_0));
{
Input_get_mouseScrollDelta_Injected_mB4D24BDB2FEAA16E6AEBE2383783AFA00463945B((Vector2_tA85D2DD88578276CA8A8796756458277E72D073D *)(&V_0), /*hidden argument*/NULL);
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_0 = V_0;
return L_0;
}
}
// UnityEngine.IMECompositionMode UnityEngine.Input::get_imeCompositionMode()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Input_get_imeCompositionMode_mAE9FA70DAEF3BE429C51FC48001368428FB2CA10 (const RuntimeMethod* method)
{
typedef int32_t (*Input_get_imeCompositionMode_mAE9FA70DAEF3BE429C51FC48001368428FB2CA10_ftn) ();
static Input_get_imeCompositionMode_mAE9FA70DAEF3BE429C51FC48001368428FB2CA10_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_get_imeCompositionMode_mAE9FA70DAEF3BE429C51FC48001368428FB2CA10_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::get_imeCompositionMode()");
int32_t retVal = _il2cpp_icall_func();
return retVal;
}
// System.Void UnityEngine.Input::set_imeCompositionMode(UnityEngine.IMECompositionMode)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Input_set_imeCompositionMode_m28AAFBFFD38640C3E0F15809C5D0C165B1EEA9A6 (int32_t ___value0, const RuntimeMethod* method)
{
typedef void (*Input_set_imeCompositionMode_m28AAFBFFD38640C3E0F15809C5D0C165B1EEA9A6_ftn) (int32_t);
static Input_set_imeCompositionMode_m28AAFBFFD38640C3E0F15809C5D0C165B1EEA9A6_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_set_imeCompositionMode_m28AAFBFFD38640C3E0F15809C5D0C165B1EEA9A6_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::set_imeCompositionMode(UnityEngine.IMECompositionMode)");
_il2cpp_icall_func(___value0);
}
// System.String UnityEngine.Input::get_compositionString()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR String_t* Input_get_compositionString_mA2BEBDED6F15265EDDB37D9E7160FE7580D7617C (const RuntimeMethod* method)
{
typedef String_t* (*Input_get_compositionString_mA2BEBDED6F15265EDDB37D9E7160FE7580D7617C_ftn) ();
static Input_get_compositionString_mA2BEBDED6F15265EDDB37D9E7160FE7580D7617C_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_get_compositionString_mA2BEBDED6F15265EDDB37D9E7160FE7580D7617C_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::get_compositionString()");
String_t* retVal = _il2cpp_icall_func();
return retVal;
}
// UnityEngine.Vector2 UnityEngine.Input::get_compositionCursorPos()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector2_tA85D2DD88578276CA8A8796756458277E72D073D Input_get_compositionCursorPos_mCCF0BB765BC2668E19AD2832DEE7A3D1882777D8 (const RuntimeMethod* method)
{
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D V_0;
memset((&V_0), 0, sizeof(V_0));
{
Input_get_compositionCursorPos_Injected_m513709187290CBEF2788BA0B61B7D5A056731195((Vector2_tA85D2DD88578276CA8A8796756458277E72D073D *)(&V_0), /*hidden argument*/NULL);
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_0 = V_0;
return L_0;
}
}
// System.Void UnityEngine.Input::set_compositionCursorPos(UnityEngine.Vector2)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Input_set_compositionCursorPos_m39EB58D705F1E2D30D45480AF918CA098189F326 (Vector2_tA85D2DD88578276CA8A8796756458277E72D073D ___value0, const RuntimeMethod* method)
{
{
Input_set_compositionCursorPos_Injected_mFED26C8FCDE955B227669C9023108D41E65766E1((Vector2_tA85D2DD88578276CA8A8796756458277E72D073D *)(&___value0), /*hidden argument*/NULL);
return;
}
}
// System.Boolean UnityEngine.Input::get_mousePresent()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_get_mousePresent_m84357E5B596CD17272874EF83E2D2F2864580E05 (const RuntimeMethod* method)
{
typedef bool (*Input_get_mousePresent_m84357E5B596CD17272874EF83E2D2F2864580E05_ftn) ();
static Input_get_mousePresent_m84357E5B596CD17272874EF83E2D2F2864580E05_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_get_mousePresent_m84357E5B596CD17272874EF83E2D2F2864580E05_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::get_mousePresent()");
bool retVal = _il2cpp_icall_func();
return retVal;
}
// System.Int32 UnityEngine.Input::get_touchCount()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Input_get_touchCount_m497E19AA4FA22DB659F631B20FAEF65572D1B44E (const RuntimeMethod* method)
{
typedef int32_t (*Input_get_touchCount_m497E19AA4FA22DB659F631B20FAEF65572D1B44E_ftn) ();
static Input_get_touchCount_m497E19AA4FA22DB659F631B20FAEF65572D1B44E_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_get_touchCount_m497E19AA4FA22DB659F631B20FAEF65572D1B44E_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::get_touchCount()");
int32_t retVal = _il2cpp_icall_func();
return retVal;
}
// System.Boolean UnityEngine.Input::get_touchSupported()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Input_get_touchSupported_m59811A353627249C934E8FF7A6F3C4A7883978E9 (const RuntimeMethod* method)
{
typedef bool (*Input_get_touchSupported_m59811A353627249C934E8FF7A6F3C4A7883978E9_ftn) ();
static Input_get_touchSupported_m59811A353627249C934E8FF7A6F3C4A7883978E9_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_get_touchSupported_m59811A353627249C934E8FF7A6F3C4A7883978E9_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::get_touchSupported()");
bool retVal = _il2cpp_icall_func();
return retVal;
}
// System.Void UnityEngine.Input::GetTouch_Injected(System.Int32,UnityEngine.Touch&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Input_GetTouch_Injected_mDD8AC74C22DC466C6CC45C46A2089FCF5F4F5CFB (int32_t ___index0, Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * ___ret1, const RuntimeMethod* method)
{
typedef void (*Input_GetTouch_Injected_mDD8AC74C22DC466C6CC45C46A2089FCF5F4F5CFB_ftn) (int32_t, Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 *);
static Input_GetTouch_Injected_mDD8AC74C22DC466C6CC45C46A2089FCF5F4F5CFB_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_GetTouch_Injected_mDD8AC74C22DC466C6CC45C46A2089FCF5F4F5CFB_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::GetTouch_Injected(System.Int32,UnityEngine.Touch&)");
_il2cpp_icall_func(___index0, ___ret1);
}
// System.Void UnityEngine.Input::get_mousePosition_Injected(UnityEngine.Vector3&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Input_get_mousePosition_Injected_m16BF01CA8D64169CE48F8EA804A3F25832316B63 (Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 * ___ret0, const RuntimeMethod* method)
{
typedef void (*Input_get_mousePosition_Injected_m16BF01CA8D64169CE48F8EA804A3F25832316B63_ftn) (Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 *);
static Input_get_mousePosition_Injected_m16BF01CA8D64169CE48F8EA804A3F25832316B63_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_get_mousePosition_Injected_m16BF01CA8D64169CE48F8EA804A3F25832316B63_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::get_mousePosition_Injected(UnityEngine.Vector3&)");
_il2cpp_icall_func(___ret0);
}
// System.Void UnityEngine.Input::get_mouseScrollDelta_Injected(UnityEngine.Vector2&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Input_get_mouseScrollDelta_Injected_mB4D24BDB2FEAA16E6AEBE2383783AFA00463945B (Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * ___ret0, const RuntimeMethod* method)
{
typedef void (*Input_get_mouseScrollDelta_Injected_mB4D24BDB2FEAA16E6AEBE2383783AFA00463945B_ftn) (Vector2_tA85D2DD88578276CA8A8796756458277E72D073D *);
static Input_get_mouseScrollDelta_Injected_mB4D24BDB2FEAA16E6AEBE2383783AFA00463945B_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_get_mouseScrollDelta_Injected_mB4D24BDB2FEAA16E6AEBE2383783AFA00463945B_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::get_mouseScrollDelta_Injected(UnityEngine.Vector2&)");
_il2cpp_icall_func(___ret0);
}
// System.Void UnityEngine.Input::get_compositionCursorPos_Injected(UnityEngine.Vector2&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Input_get_compositionCursorPos_Injected_m513709187290CBEF2788BA0B61B7D5A056731195 (Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * ___ret0, const RuntimeMethod* method)
{
typedef void (*Input_get_compositionCursorPos_Injected_m513709187290CBEF2788BA0B61B7D5A056731195_ftn) (Vector2_tA85D2DD88578276CA8A8796756458277E72D073D *);
static Input_get_compositionCursorPos_Injected_m513709187290CBEF2788BA0B61B7D5A056731195_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_get_compositionCursorPos_Injected_m513709187290CBEF2788BA0B61B7D5A056731195_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::get_compositionCursorPos_Injected(UnityEngine.Vector2&)");
_il2cpp_icall_func(___ret0);
}
// System.Void UnityEngine.Input::set_compositionCursorPos_Injected(UnityEngine.Vector2&)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void Input_set_compositionCursorPos_Injected_mFED26C8FCDE955B227669C9023108D41E65766E1 (Vector2_tA85D2DD88578276CA8A8796756458277E72D073D * ___value0, const RuntimeMethod* method)
{
typedef void (*Input_set_compositionCursorPos_Injected_mFED26C8FCDE955B227669C9023108D41E65766E1_ftn) (Vector2_tA85D2DD88578276CA8A8796756458277E72D073D *);
static Input_set_compositionCursorPos_Injected_mFED26C8FCDE955B227669C9023108D41E65766E1_ftn _il2cpp_icall_func;
if (!_il2cpp_icall_func)
_il2cpp_icall_func = (Input_set_compositionCursorPos_Injected_mFED26C8FCDE955B227669C9023108D41E65766E1_ftn)il2cpp_codegen_resolve_icall ("UnityEngine.Input::set_compositionCursorPos_Injected(UnityEngine.Vector2&)");
_il2cpp_icall_func(___value0);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Void UnityEngine.SendMouseEvents::SetMouseMoved()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void SendMouseEvents_SetMouseMoved_m9B185D9ECD0C159C5DFA17F8F0ECBFD3420F32A6 (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (SendMouseEvents_SetMouseMoved_m9B185D9ECD0C159C5DFA17F8F0ECBFD3420F32A6_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->set_s_MouseUsed_0((bool)1);
return;
}
}
// System.Void UnityEngine.SendMouseEvents::DoSendMouseEvents(System.Int32)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void SendMouseEvents_DoSendMouseEvents_m045BF5CABD2F263140E5F1427F81702EE0D3C507 (int32_t ___skipRTCameras0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (SendMouseEvents_DoSendMouseEvents_m045BF5CABD2F263140E5F1427F81702EE0D3C507_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 V_0;
memset((&V_0), 0, sizeof(V_0));
int32_t V_1 = 0;
bool V_2 = false;
int32_t V_3 = 0;
bool V_4 = false;
bool V_5 = false;
CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* V_6 = NULL;
int32_t V_7 = 0;
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * V_8 = NULL;
int32_t V_9 = 0;
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 V_10;
memset((&V_10), 0, sizeof(V_10));
Rect_t35B976DE901B5423C11705E156938EA27AB402CE V_11;
memset((&V_11), 0, sizeof(V_11));
Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 V_12;
memset((&V_12), 0, sizeof(V_12));
float V_13 = 0.0f;
float V_14 = 0.0f;
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * V_15 = NULL;
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * V_16 = NULL;
bool V_17 = false;
bool V_18 = false;
int32_t V_19 = 0;
float V_20 = 0.0f;
float V_21 = 0.0f;
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D V_22;
memset((&V_22), 0, sizeof(V_22));
bool V_23 = false;
bool V_24 = false;
bool V_25 = false;
bool V_26 = false;
bool V_27 = false;
bool V_28 = false;
bool V_29 = false;
bool V_30 = false;
bool V_31 = false;
int32_t V_32 = 0;
bool V_33 = false;
int32_t G_B3_0 = 0;
int32_t G_B14_0 = 0;
int32_t G_B16_0 = 0;
int32_t G_B24_0 = 0;
int32_t G_B31_0 = 0;
float G_B42_0 = 0.0f;
int32_t G_B47_0 = 0;
int32_t G_B54_0 = 0;
{
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_0 = Input_get_mousePosition_m1F6706785983B41FE8D5CBB81B5F15F68EBD9A53(/*hidden argument*/NULL);
V_0 = L_0;
int32_t L_1 = Camera_get_allCamerasCount_mF6CDC46D6F61B1F1A0337A9AD7DFA485E408E6A1(/*hidden argument*/NULL);
V_1 = L_1;
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* L_2 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_Cameras_4();
if (!L_2)
{
goto IL_0023;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* L_3 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_Cameras_4();
NullCheck(L_3);
int32_t L_4 = V_1;
G_B3_0 = ((((int32_t)((((int32_t)(((int32_t)((int32_t)(((RuntimeArray*)L_3)->max_length))))) == ((int32_t)L_4))? 1 : 0)) == ((int32_t)0))? 1 : 0);
goto IL_0024;
}
IL_0023:
{
G_B3_0 = 1;
}
IL_0024:
{
V_2 = (bool)G_B3_0;
bool L_5 = V_2;
if (!L_5)
{
goto IL_0033;
}
}
{
int32_t L_6 = V_1;
CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* L_7 = (CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9*)(CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9*)SZArrayNew(CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9_il2cpp_TypeInfo_var, (uint32_t)L_6);
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->set_m_Cameras_4(L_7);
}
IL_0033:
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* L_8 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_Cameras_4();
Camera_GetAllCameras_m500A4F27E7BE1C259E9EAA0AEBB1E1B35893059C(L_8, /*hidden argument*/NULL);
V_3 = 0;
goto IL_0057;
}
IL_0042:
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_9 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_CurrentHit_3();
int32_t L_10 = V_3;
NullCheck(L_9);
il2cpp_codegen_initobj(((L_9)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_10))), sizeof(HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 ));
int32_t L_11 = V_3;
V_3 = ((int32_t)il2cpp_codegen_add((int32_t)L_11, (int32_t)1));
}
IL_0057:
{
int32_t L_12 = V_3;
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_13 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_CurrentHit_3();
NullCheck(L_13);
V_4 = (bool)((((int32_t)L_12) < ((int32_t)(((int32_t)((int32_t)(((RuntimeArray*)L_13)->max_length))))))? 1 : 0);
bool L_14 = V_4;
if (L_14)
{
goto IL_0042;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
bool L_15 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_s_MouseUsed_0();
V_5 = (bool)((((int32_t)L_15) == ((int32_t)0))? 1 : 0);
bool L_16 = V_5;
if (!L_16)
{
goto IL_036a;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* L_17 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_Cameras_4();
V_6 = L_17;
V_7 = 0;
goto IL_035e;
}
IL_0089:
{
CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* L_18 = V_6;
int32_t L_19 = V_7;
NullCheck(L_18);
int32_t L_20 = L_19;
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_21 = (L_18)->GetAt(static_cast<il2cpp_array_size_t>(L_20));
V_8 = L_21;
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_22 = V_8;
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_23 = Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C(L_22, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL);
if (L_23)
{
goto IL_00b0;
}
}
{
int32_t L_24 = ___skipRTCameras0;
if (!L_24)
{
goto IL_00ad;
}
}
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_25 = V_8;
NullCheck(L_25);
RenderTexture_tBC47D853E3DA6511CD6C49DBF78D47B890FCD2F6 * L_26 = Camera_get_targetTexture_m1E776560FAC888D8210D49CEE310BB39D34A3FDC(L_25, /*hidden argument*/NULL);
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_27 = Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1(L_26, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL);
G_B14_0 = ((int32_t)(L_27));
goto IL_00ae;
}
IL_00ad:
{
G_B14_0 = 0;
}
IL_00ae:
{
G_B16_0 = G_B14_0;
goto IL_00b1;
}
IL_00b0:
{
G_B16_0 = 1;
}
IL_00b1:
{
V_17 = (bool)G_B16_0;
bool L_28 = V_17;
if (!L_28)
{
goto IL_00bc;
}
}
{
goto IL_0358;
}
IL_00bc:
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_29 = V_8;
NullCheck(L_29);
int32_t L_30 = Camera_get_targetDisplay_m2C318D2EB9A016FEC76B13F7F7AE382F443FB731(L_29, /*hidden argument*/NULL);
V_9 = L_30;
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_31 = V_0;
IL2CPP_RUNTIME_CLASS_INIT(Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_il2cpp_TypeInfo_var);
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_32 = Display_RelativeMouseAt_mABDA4BAC2C1B328A2C6A205D552AA5488BFFAA93(L_31, /*hidden argument*/NULL);
V_10 = L_32;
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_33 = V_10;
IL2CPP_RUNTIME_CLASS_INIT(Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720_il2cpp_TypeInfo_var);
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_34 = Vector3_get_zero_m3CDDCAE94581DF3BB16C4B40A100E28E9C6649C2(/*hidden argument*/NULL);
bool L_35 = Vector3_op_Inequality_mFEEAA4C4BF743FB5B8A47FF4967A5E2C73273D6E(L_33, L_34, /*hidden argument*/NULL);
V_18 = L_35;
bool L_36 = V_18;
if (!L_36)
{
goto IL_01b0;
}
}
{
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_37 = V_10;
float L_38 = L_37.get_z_4();
V_19 = (((int32_t)((int32_t)L_38)));
int32_t L_39 = V_19;
int32_t L_40 = V_9;
V_23 = (bool)((((int32_t)((((int32_t)L_39) == ((int32_t)L_40))? 1 : 0)) == ((int32_t)0))? 1 : 0);
bool L_41 = V_23;
if (!L_41)
{
goto IL_0101;
}
}
{
goto IL_0358;
}
IL_0101:
{
int32_t L_42 = Screen_get_width_m8ECCEF7FF17395D1237BC0193D7A6640A3FEEAD3(/*hidden argument*/NULL);
V_20 = (((float)((float)L_42)));
int32_t L_43 = Screen_get_height_mF5B64EBC4CDE0EAAA5713C1452ED2CE475F25150(/*hidden argument*/NULL);
V_21 = (((float)((float)L_43)));
int32_t L_44 = V_9;
if ((((int32_t)L_44) <= ((int32_t)0)))
{
goto IL_0123;
}
}
{
int32_t L_45 = V_9;
IL2CPP_RUNTIME_CLASS_INIT(Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_il2cpp_TypeInfo_var);
DisplayU5BU5D_tB2AB0FDB3B2E9FD784D5100C18EB0ED489A2CCC9* L_46 = ((Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_StaticFields*)il2cpp_codegen_static_fields_for(Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_il2cpp_TypeInfo_var))->get_displays_1();
NullCheck(L_46);
G_B24_0 = ((((int32_t)L_45) < ((int32_t)(((int32_t)((int32_t)(((RuntimeArray*)L_46)->max_length))))))? 1 : 0);
goto IL_0124;
}
IL_0123:
{
G_B24_0 = 0;
}
IL_0124:
{
V_24 = (bool)G_B24_0;
bool L_47 = V_24;
if (!L_47)
{
goto IL_014c;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_il2cpp_TypeInfo_var);
DisplayU5BU5D_tB2AB0FDB3B2E9FD784D5100C18EB0ED489A2CCC9* L_48 = ((Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_StaticFields*)il2cpp_codegen_static_fields_for(Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_il2cpp_TypeInfo_var))->get_displays_1();
int32_t L_49 = V_9;
NullCheck(L_48);
int32_t L_50 = L_49;
Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 * L_51 = (L_48)->GetAt(static_cast<il2cpp_array_size_t>(L_50));
NullCheck(L_51);
int32_t L_52 = Display_get_systemWidth_mA14AF2D3B017CF4BA2C2990DC2398E528AF83413(L_51, /*hidden argument*/NULL);
V_20 = (((float)((float)L_52)));
DisplayU5BU5D_tB2AB0FDB3B2E9FD784D5100C18EB0ED489A2CCC9* L_53 = ((Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_StaticFields*)il2cpp_codegen_static_fields_for(Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57_il2cpp_TypeInfo_var))->get_displays_1();
int32_t L_54 = V_9;
NullCheck(L_53);
int32_t L_55 = L_54;
Display_t38AD3008E8C72693533E4FE9CFFF6E01B56E9D57 * L_56 = (L_53)->GetAt(static_cast<il2cpp_array_size_t>(L_55));
NullCheck(L_56);
int32_t L_57 = Display_get_systemHeight_m0D7950CB39015167C175634EF8A5E0C52FBF5EC7(L_56, /*hidden argument*/NULL);
V_21 = (((float)((float)L_57)));
}
IL_014c:
{
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_58 = V_10;
float L_59 = L_58.get_x_2();
float L_60 = V_20;
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_61 = V_10;
float L_62 = L_61.get_y_3();
float L_63 = V_21;
Vector2__ctor_mEE8FB117AB1F8DB746FB8B3EB4C0DA3BF2A230D0((Vector2_tA85D2DD88578276CA8A8796756458277E72D073D *)(&V_22), ((float)((float)L_59/(float)L_60)), ((float)((float)L_62/(float)L_63)), /*hidden argument*/NULL);
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_64 = V_22;
float L_65 = L_64.get_x_0();
if ((((float)L_65) < ((float)(0.0f))))
{
goto IL_01a1;
}
}
{
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_66 = V_22;
float L_67 = L_66.get_x_0();
if ((((float)L_67) > ((float)(1.0f))))
{
goto IL_01a1;
}
}
{
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_68 = V_22;
float L_69 = L_68.get_y_1();
if ((((float)L_69) < ((float)(0.0f))))
{
goto IL_01a1;
}
}
{
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_70 = V_22;
float L_71 = L_70.get_y_1();
G_B31_0 = ((((float)L_71) > ((float)(1.0f)))? 1 : 0);
goto IL_01a2;
}
IL_01a1:
{
G_B31_0 = 1;
}
IL_01a2:
{
V_25 = (bool)G_B31_0;
bool L_72 = V_25;
if (!L_72)
{
goto IL_01ad;
}
}
{
goto IL_0358;
}
IL_01ad:
{
goto IL_01b5;
}
IL_01b0:
{
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_73 = V_0;
V_10 = L_73;
}
IL_01b5:
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_74 = V_8;
NullCheck(L_74);
Rect_t35B976DE901B5423C11705E156938EA27AB402CE L_75 = Camera_get_pixelRect_mBA87D6C23FD7A5E1A7F3CE0E8F9B86A9318B5317(L_74, /*hidden argument*/NULL);
V_11 = L_75;
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_76 = V_10;
bool L_77 = Rect_Contains_m5072228CE6251E7C754F227BA330F9ADA95C1495((Rect_t35B976DE901B5423C11705E156938EA27AB402CE *)(&V_11), L_76, /*hidden argument*/NULL);
V_26 = (bool)((((int32_t)L_77) == ((int32_t)0))? 1 : 0);
bool L_78 = V_26;
if (!L_78)
{
goto IL_01d5;
}
}
{
goto IL_0358;
}
IL_01d5:
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_79 = V_8;
NullCheck(L_79);
int32_t L_80 = Camera_get_eventMask_m1D85900090AF34244340C69B53A42CDE5E9669D3(L_79, /*hidden argument*/NULL);
V_27 = (bool)((((int32_t)L_80) == ((int32_t)0))? 1 : 0);
bool L_81 = V_27;
if (!L_81)
{
goto IL_01ea;
}
}
{
goto IL_0358;
}
IL_01ea:
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_82 = V_8;
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_83 = V_10;
NullCheck(L_82);
Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 L_84 = Camera_ScreenPointToRay_m27638E78502DB6D6D7113F81AF7C210773B828F3(L_82, L_83, /*hidden argument*/NULL);
V_12 = L_84;
Vector3_tDCF05E21F632FE2BA260C06E0D10CA81513E6720 L_85 = Ray_get_direction_m9E6468CD87844B437FC4B93491E63D388322F76E((Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 *)(&V_12), /*hidden argument*/NULL);
float L_86 = L_85.get_z_4();
V_13 = L_86;
float L_87 = V_13;
IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var);
bool L_88 = Mathf_Approximately_m91AF00403E0D2DEA1AAE68601AD218CFAD70DF7E((0.0f), L_87, /*hidden argument*/NULL);
if (L_88)
{
goto IL_022a;
}
}
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_89 = V_8;
NullCheck(L_89);
float L_90 = Camera_get_farClipPlane_mF51F1FF5BE87719CFAC293E272B1138DC1EFFD4B(L_89, /*hidden argument*/NULL);
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_91 = V_8;
NullCheck(L_91);
float L_92 = Camera_get_nearClipPlane_mD9D3E3D27186BBAC2CC354CE3609E6118A5BF66C(L_91, /*hidden argument*/NULL);
float L_93 = V_13;
IL2CPP_RUNTIME_CLASS_INIT(Mathf_tFBDE6467D269BFE410605C7D806FD9991D4A89CB_il2cpp_TypeInfo_var);
float L_94 = fabsf(((float)((float)((float)il2cpp_codegen_subtract((float)L_90, (float)L_92))/(float)L_93)));
G_B42_0 = L_94;
goto IL_022f;
}
IL_022a:
{
G_B42_0 = (std::numeric_limits<float>::infinity());
}
IL_022f:
{
V_14 = G_B42_0;
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_95 = V_8;
Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 L_96 = V_12;
float L_97 = V_14;
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_98 = V_8;
NullCheck(L_98);
int32_t L_99 = Camera_get_cullingMask_m0992E96D87A4221E38746EBD882780CEFF7C2BCD(L_98, /*hidden argument*/NULL);
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_100 = V_8;
NullCheck(L_100);
int32_t L_101 = Camera_get_eventMask_m1D85900090AF34244340C69B53A42CDE5E9669D3(L_100, /*hidden argument*/NULL);
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_102 = CameraRaycastHelper_RaycastTry_m6E6369E18DAA7CA518D8B826E1030FFBDAA79B95(L_95, L_96, L_97, ((int32_t)((int32_t)L_99&(int32_t)L_101)), /*hidden argument*/NULL);
V_15 = L_102;
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_103 = V_15;
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_104 = Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1(L_103, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL);
V_28 = L_104;
bool L_105 = V_28;
if (!L_105)
{
goto IL_0283;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_106 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_CurrentHit_3();
NullCheck(L_106);
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_107 = V_15;
((L_106)->GetAddressAt(static_cast<il2cpp_array_size_t>(1)))->set_target_0(L_107);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_108 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_CurrentHit_3();
NullCheck(L_108);
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_109 = V_8;
((L_108)->GetAddressAt(static_cast<il2cpp_array_size_t>(1)))->set_camera_1(L_109);
goto IL_02c4;
}
IL_0283:
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_110 = V_8;
NullCheck(L_110);
int32_t L_111 = Camera_get_clearFlags_m1D02BA1ABD7310269F6121C58AF41DCDEF1E0266(L_110, /*hidden argument*/NULL);
if ((((int32_t)L_111) == ((int32_t)1)))
{
goto IL_0299;
}
}
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_112 = V_8;
NullCheck(L_112);
int32_t L_113 = Camera_get_clearFlags_m1D02BA1ABD7310269F6121C58AF41DCDEF1E0266(L_112, /*hidden argument*/NULL);
G_B47_0 = ((((int32_t)L_113) == ((int32_t)2))? 1 : 0);
goto IL_029a;
}
IL_0299:
{
G_B47_0 = 1;
}
IL_029a:
{
V_29 = (bool)G_B47_0;
bool L_114 = V_29;
if (!L_114)
{
goto IL_02c4;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_115 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_CurrentHit_3();
NullCheck(L_115);
((L_115)->GetAddressAt(static_cast<il2cpp_array_size_t>(1)))->set_target_0((GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F *)NULL);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_116 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_CurrentHit_3();
NullCheck(L_116);
((L_116)->GetAddressAt(static_cast<il2cpp_array_size_t>(1)))->set_camera_1((Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 *)NULL);
}
IL_02c4:
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_117 = V_8;
Ray_tE2163D4CB3E6B267E29F8ABE41684490E4A614B2 L_118 = V_12;
float L_119 = V_14;
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_120 = V_8;
NullCheck(L_120);
int32_t L_121 = Camera_get_cullingMask_m0992E96D87A4221E38746EBD882780CEFF7C2BCD(L_120, /*hidden argument*/NULL);
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_122 = V_8;
NullCheck(L_122);
int32_t L_123 = Camera_get_eventMask_m1D85900090AF34244340C69B53A42CDE5E9669D3(L_122, /*hidden argument*/NULL);
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_124 = CameraRaycastHelper_RaycastTry2D_mE4F905B8FC0FC471EB8DDF2F3B8A7C2B9E54CEDE(L_117, L_118, L_119, ((int32_t)((int32_t)L_121&(int32_t)L_123)), /*hidden argument*/NULL);
V_16 = L_124;
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_125 = V_16;
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_126 = Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1(L_125, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL);
V_30 = L_126;
bool L_127 = V_30;
if (!L_127)
{
goto IL_0316;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_128 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_CurrentHit_3();
NullCheck(L_128);
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_129 = V_16;
((L_128)->GetAddressAt(static_cast<il2cpp_array_size_t>(2)))->set_target_0(L_129);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_130 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_CurrentHit_3();
NullCheck(L_130);
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_131 = V_8;
((L_130)->GetAddressAt(static_cast<il2cpp_array_size_t>(2)))->set_camera_1(L_131);
goto IL_0357;
}
IL_0316:
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_132 = V_8;
NullCheck(L_132);
int32_t L_133 = Camera_get_clearFlags_m1D02BA1ABD7310269F6121C58AF41DCDEF1E0266(L_132, /*hidden argument*/NULL);
if ((((int32_t)L_133) == ((int32_t)1)))
{
goto IL_032c;
}
}
{
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_134 = V_8;
NullCheck(L_134);
int32_t L_135 = Camera_get_clearFlags_m1D02BA1ABD7310269F6121C58AF41DCDEF1E0266(L_134, /*hidden argument*/NULL);
G_B54_0 = ((((int32_t)L_135) == ((int32_t)2))? 1 : 0);
goto IL_032d;
}
IL_032c:
{
G_B54_0 = 1;
}
IL_032d:
{
V_31 = (bool)G_B54_0;
bool L_136 = V_31;
if (!L_136)
{
goto IL_0357;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_137 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_CurrentHit_3();
NullCheck(L_137);
((L_137)->GetAddressAt(static_cast<il2cpp_array_size_t>(2)))->set_target_0((GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F *)NULL);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_138 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_CurrentHit_3();
NullCheck(L_138);
((L_138)->GetAddressAt(static_cast<il2cpp_array_size_t>(2)))->set_camera_1((Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 *)NULL);
}
IL_0357:
{
}
IL_0358:
{
int32_t L_139 = V_7;
V_7 = ((int32_t)il2cpp_codegen_add((int32_t)L_139, (int32_t)1));
}
IL_035e:
{
int32_t L_140 = V_7;
CameraU5BU5D_t2A1957E88FB79357C12B87941970D776D30E90F9* L_141 = V_6;
NullCheck(L_141);
if ((((int32_t)L_140) < ((int32_t)(((int32_t)((int32_t)(((RuntimeArray*)L_141)->max_length)))))))
{
goto IL_0089;
}
}
{
}
IL_036a:
{
V_32 = 0;
goto IL_0389;
}
IL_036f:
{
int32_t L_142 = V_32;
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_143 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_CurrentHit_3();
int32_t L_144 = V_32;
NullCheck(L_143);
int32_t L_145 = L_144;
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_146 = (L_143)->GetAt(static_cast<il2cpp_array_size_t>(L_145));
SendMouseEvents_SendEvents_m2E266CFBE23F89BA8563312C8488DF1E9A7C25F0(L_142, L_146, /*hidden argument*/NULL);
int32_t L_147 = V_32;
V_32 = ((int32_t)il2cpp_codegen_add((int32_t)L_147, (int32_t)1));
}
IL_0389:
{
int32_t L_148 = V_32;
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_149 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_CurrentHit_3();
NullCheck(L_149);
V_33 = (bool)((((int32_t)L_148) < ((int32_t)(((int32_t)((int32_t)(((RuntimeArray*)L_149)->max_length))))))? 1 : 0);
bool L_150 = V_33;
if (L_150)
{
goto IL_036f;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->set_s_MouseUsed_0((bool)0);
return;
}
}
// System.Void UnityEngine.SendMouseEvents::SendEvents(System.Int32,UnityEngine.SendMouseEvents/HitInfo)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void SendMouseEvents_SendEvents_m2E266CFBE23F89BA8563312C8488DF1E9A7C25F0 (int32_t ___i0, HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 ___hit1, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (SendMouseEvents_SendEvents_m2E266CFBE23F89BA8563312C8488DF1E9A7C25F0_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
bool V_1 = false;
bool V_2 = false;
bool V_3 = false;
bool V_4 = false;
bool V_5 = false;
bool V_6 = false;
bool V_7 = false;
bool V_8 = false;
bool V_9 = false;
bool V_10 = false;
bool V_11 = false;
{
bool L_0 = Input_GetMouseButtonDown_m5AD76E22AA839706219AD86A4E0BE5276AF8E28A(0, /*hidden argument*/NULL);
V_0 = L_0;
bool L_1 = Input_GetMouseButton_m43C68DE93C7D990E875BA53C4DEC9CA6230C8B79(0, /*hidden argument*/NULL);
V_1 = L_1;
bool L_2 = V_0;
V_2 = L_2;
bool L_3 = V_2;
if (!L_3)
{
goto IL_0049;
}
}
{
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_4 = ___hit1;
bool L_5 = HitInfo_op_Implicit_mBB6DB77D68B22445EC255E34E7EE7667FD584322(L_4, /*hidden argument*/NULL);
V_3 = L_5;
bool L_6 = V_3;
if (!L_6)
{
goto IL_0043;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_7 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_MouseDownHit_2();
int32_t L_8 = ___i0;
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_9 = ___hit1;
NullCheck(L_7);
(L_7)->SetAt(static_cast<il2cpp_array_size_t>(L_8), (HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 )L_9);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_10 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_MouseDownHit_2();
int32_t L_11 = ___i0;
NullCheck(L_10);
HitInfo_SendMessage_m03D1D4402F97AA2D7E4A1D8A8C18A313B5DE6434((HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 *)((L_10)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_11))), _stringLiteral3FD91E160022E3A1414EFC9052F3C6C31F1EA4F4, /*hidden argument*/NULL);
}
IL_0043:
{
goto IL_00f1;
}
IL_0049:
{
bool L_12 = V_1;
V_4 = (bool)((((int32_t)L_12) == ((int32_t)0))? 1 : 0);
bool L_13 = V_4;
if (!L_13)
{
goto IL_00c3;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_14 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_MouseDownHit_2();
int32_t L_15 = ___i0;
NullCheck(L_14);
int32_t L_16 = L_15;
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_17 = (L_14)->GetAt(static_cast<il2cpp_array_size_t>(L_16));
bool L_18 = HitInfo_op_Implicit_mBB6DB77D68B22445EC255E34E7EE7667FD584322(L_17, /*hidden argument*/NULL);
V_5 = L_18;
bool L_19 = V_5;
if (!L_19)
{
goto IL_00c0;
}
}
{
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_20 = ___hit1;
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_21 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_MouseDownHit_2();
int32_t L_22 = ___i0;
NullCheck(L_21);
int32_t L_23 = L_22;
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_24 = (L_21)->GetAt(static_cast<il2cpp_array_size_t>(L_23));
bool L_25 = HitInfo_Compare_m5643F7A11E2F60B86286330548DF614BD9691582(L_20, L_24, /*hidden argument*/NULL);
V_6 = L_25;
bool L_26 = V_6;
if (!L_26)
{
goto IL_0098;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_27 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_MouseDownHit_2();
int32_t L_28 = ___i0;
NullCheck(L_27);
HitInfo_SendMessage_m03D1D4402F97AA2D7E4A1D8A8C18A313B5DE6434((HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 *)((L_27)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_28))), _stringLiteralB8B6C4E8F01128F85B1997A2FC54F0D8A7847473, /*hidden argument*/NULL);
}
IL_0098:
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_29 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_MouseDownHit_2();
int32_t L_30 = ___i0;
NullCheck(L_29);
HitInfo_SendMessage_m03D1D4402F97AA2D7E4A1D8A8C18A313B5DE6434((HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 *)((L_29)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_30))), _stringLiteralD0F250C5C723619F2F208B1992BA356D32807BE6, /*hidden argument*/NULL);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_31 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_MouseDownHit_2();
int32_t L_32 = ___i0;
NullCheck(L_31);
il2cpp_codegen_initobj(((L_31)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_32))), sizeof(HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 ));
}
IL_00c0:
{
goto IL_00f1;
}
IL_00c3:
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_33 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_MouseDownHit_2();
int32_t L_34 = ___i0;
NullCheck(L_33);
int32_t L_35 = L_34;
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_36 = (L_33)->GetAt(static_cast<il2cpp_array_size_t>(L_35));
bool L_37 = HitInfo_op_Implicit_mBB6DB77D68B22445EC255E34E7EE7667FD584322(L_36, /*hidden argument*/NULL);
V_7 = L_37;
bool L_38 = V_7;
if (!L_38)
{
goto IL_00f1;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_39 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_MouseDownHit_2();
int32_t L_40 = ___i0;
NullCheck(L_39);
HitInfo_SendMessage_m03D1D4402F97AA2D7E4A1D8A8C18A313B5DE6434((HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 *)((L_39)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_40))), _stringLiteralC2DD4A1CF2BEA8DC20037D0E70DA4065B69442E6, /*hidden argument*/NULL);
}
IL_00f1:
{
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_41 = ___hit1;
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_42 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_LastHit_1();
int32_t L_43 = ___i0;
NullCheck(L_42);
int32_t L_44 = L_43;
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_45 = (L_42)->GetAt(static_cast<il2cpp_array_size_t>(L_44));
bool L_46 = HitInfo_Compare_m5643F7A11E2F60B86286330548DF614BD9691582(L_41, L_45, /*hidden argument*/NULL);
V_8 = L_46;
bool L_47 = V_8;
if (!L_47)
{
goto IL_0125;
}
}
{
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_48 = ___hit1;
bool L_49 = HitInfo_op_Implicit_mBB6DB77D68B22445EC255E34E7EE7667FD584322(L_48, /*hidden argument*/NULL);
V_9 = L_49;
bool L_50 = V_9;
if (!L_50)
{
goto IL_0122;
}
}
{
HitInfo_SendMessage_m03D1D4402F97AA2D7E4A1D8A8C18A313B5DE6434((HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 *)(&___hit1), _stringLiteral38C0F0DBDBD6845E1EB1973902069AA0D04A49CB, /*hidden argument*/NULL);
}
IL_0122:
{
goto IL_017d;
}
IL_0125:
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_51 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_LastHit_1();
int32_t L_52 = ___i0;
NullCheck(L_51);
int32_t L_53 = L_52;
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_54 = (L_51)->GetAt(static_cast<il2cpp_array_size_t>(L_53));
bool L_55 = HitInfo_op_Implicit_mBB6DB77D68B22445EC255E34E7EE7667FD584322(L_54, /*hidden argument*/NULL);
V_10 = L_55;
bool L_56 = V_10;
if (!L_56)
{
goto IL_0154;
}
}
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_57 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_LastHit_1();
int32_t L_58 = ___i0;
NullCheck(L_57);
HitInfo_SendMessage_m03D1D4402F97AA2D7E4A1D8A8C18A313B5DE6434((HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 *)((L_57)->GetAddressAt(static_cast<il2cpp_array_size_t>(L_58))), _stringLiteralA7657254AB620ED4022229A87EBBB2D61A66BB47, /*hidden argument*/NULL);
}
IL_0154:
{
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_59 = ___hit1;
bool L_60 = HitInfo_op_Implicit_mBB6DB77D68B22445EC255E34E7EE7667FD584322(L_59, /*hidden argument*/NULL);
V_11 = L_60;
bool L_61 = V_11;
if (!L_61)
{
goto IL_017c;
}
}
{
HitInfo_SendMessage_m03D1D4402F97AA2D7E4A1D8A8C18A313B5DE6434((HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 *)(&___hit1), _stringLiteralAEEBD5451CD610FD41B563142B1715878FB6841E, /*hidden argument*/NULL);
HitInfo_SendMessage_m03D1D4402F97AA2D7E4A1D8A8C18A313B5DE6434((HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 *)(&___hit1), _stringLiteral38C0F0DBDBD6845E1EB1973902069AA0D04A49CB, /*hidden argument*/NULL);
}
IL_017c:
{
}
IL_017d:
{
IL2CPP_RUNTIME_CLASS_INIT(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_62 = ((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->get_m_LastHit_1();
int32_t L_63 = ___i0;
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_64 = ___hit1;
NullCheck(L_62);
(L_62)->SetAt(static_cast<il2cpp_array_size_t>(L_63), (HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 )L_64);
return;
}
}
// System.Void UnityEngine.SendMouseEvents::.cctor()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void SendMouseEvents__cctor_m702309EA7759031619D3963B6EA517ABEB888053 (const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (SendMouseEvents__cctor_m702309EA7759031619D3963B6EA517ABEB888053_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
{
((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->set_s_MouseUsed_0((bool)0);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_0 = (HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1*)(HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1*)SZArrayNew(HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1_il2cpp_TypeInfo_var, (uint32_t)3);
((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->set_m_LastHit_1(L_0);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_1 = (HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1*)(HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1*)SZArrayNew(HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1_il2cpp_TypeInfo_var, (uint32_t)3);
((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->set_m_MouseDownHit_2(L_1);
HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1* L_2 = (HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1*)(HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1*)SZArrayNew(HitInfoU5BU5D_t1C4C1506E0E7D22806B4ED84887D7298C8EC44A1_il2cpp_TypeInfo_var, (uint32_t)3);
((SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_StaticFields*)il2cpp_codegen_static_fields_for(SendMouseEvents_tC8FB7F3FCFF87BDF2E56E1E0D209B81943D8F666_il2cpp_TypeInfo_var))->set_m_CurrentHit_3(L_2);
return;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Conversion methods for marshalling of: UnityEngine.SendMouseEvents/HitInfo
IL2CPP_EXTERN_C void HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshal_pinvoke(const HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746& unmarshaled, HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshaled_pinvoke& marshaled)
{
Exception_t* ___target_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'target' of type 'HitInfo': Reference type field marshaling is not supported.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___target_0Exception, NULL);
}
IL2CPP_EXTERN_C void HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshal_pinvoke_back(const HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshaled_pinvoke& marshaled, HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746& unmarshaled)
{
Exception_t* ___target_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'target' of type 'HitInfo': Reference type field marshaling is not supported.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___target_0Exception, NULL);
}
// Conversion method for clean up from marshalling of: UnityEngine.SendMouseEvents/HitInfo
IL2CPP_EXTERN_C void HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshal_pinvoke_cleanup(HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshaled_pinvoke& marshaled)
{
}
// Conversion methods for marshalling of: UnityEngine.SendMouseEvents/HitInfo
IL2CPP_EXTERN_C void HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshal_com(const HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746& unmarshaled, HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshaled_com& marshaled)
{
Exception_t* ___target_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'target' of type 'HitInfo': Reference type field marshaling is not supported.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___target_0Exception, NULL);
}
IL2CPP_EXTERN_C void HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshal_com_back(const HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshaled_com& marshaled, HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746& unmarshaled)
{
Exception_t* ___target_0Exception = il2cpp_codegen_get_marshal_directive_exception("Cannot marshal field 'target' of type 'HitInfo': Reference type field marshaling is not supported.");
IL2CPP_RAISE_MANAGED_EXCEPTION(___target_0Exception, NULL);
}
// Conversion method for clean up from marshalling of: UnityEngine.SendMouseEvents/HitInfo
IL2CPP_EXTERN_C void HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshal_com_cleanup(HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746_marshaled_com& marshaled)
{
}
// System.Void UnityEngine.SendMouseEvents/HitInfo::SendMessage(System.String)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR void HitInfo_SendMessage_m03D1D4402F97AA2D7E4A1D8A8C18A313B5DE6434 (HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 * __this, String_t* ___name0, const RuntimeMethod* method)
{
{
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_0 = __this->get_target_0();
String_t* L_1 = ___name0;
NullCheck(L_0);
GameObject_SendMessage_mB9147E503F1F55C4F3BC2816C0BDA8C21EA22E95(L_0, L_1, NULL, 1, /*hidden argument*/NULL);
return;
}
}
IL2CPP_EXTERN_C void HitInfo_SendMessage_m03D1D4402F97AA2D7E4A1D8A8C18A313B5DE6434_AdjustorThunk (RuntimeObject * __this, String_t* ___name0, const RuntimeMethod* method)
{
int32_t _offset = 1;
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 * _thisAdjusted = reinterpret_cast<HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 *>(__this + _offset);
HitInfo_SendMessage_m03D1D4402F97AA2D7E4A1D8A8C18A313B5DE6434(_thisAdjusted, ___name0, method);
}
// System.Boolean UnityEngine.SendMouseEvents/HitInfo::op_Implicit(UnityEngine.SendMouseEvents/HitInfo)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool HitInfo_op_Implicit_mBB6DB77D68B22445EC255E34E7EE7667FD584322 (HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 ___exists0, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (HitInfo_op_Implicit_mBB6DB77D68B22445EC255E34E7EE7667FD584322_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
int32_t G_B3_0 = 0;
{
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_0 = ___exists0;
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_1 = L_0.get_target_0();
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_2 = Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1(L_1, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL);
if (!L_2)
{
goto IL_001d;
}
}
{
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_3 = ___exists0;
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_4 = L_3.get_camera_1();
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_5 = Object_op_Inequality_m31EF58E217E8F4BDD3E409DEF79E1AEE95874FC1(L_4, (Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *)NULL, /*hidden argument*/NULL);
G_B3_0 = ((int32_t)(L_5));
goto IL_001e;
}
IL_001d:
{
G_B3_0 = 0;
}
IL_001e:
{
V_0 = (bool)G_B3_0;
goto IL_0021;
}
IL_0021:
{
bool L_6 = V_0;
return L_6;
}
}
// System.Boolean UnityEngine.SendMouseEvents/HitInfo::Compare(UnityEngine.SendMouseEvents/HitInfo,UnityEngine.SendMouseEvents/HitInfo)
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool HitInfo_Compare_m5643F7A11E2F60B86286330548DF614BD9691582 (HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 ___lhs0, HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 ___rhs1, const RuntimeMethod* method)
{
static bool s_Il2CppMethodInitialized;
if (!s_Il2CppMethodInitialized)
{
il2cpp_codegen_initialize_method (HitInfo_Compare_m5643F7A11E2F60B86286330548DF614BD9691582_MetadataUsageId);
s_Il2CppMethodInitialized = true;
}
bool V_0 = false;
int32_t G_B3_0 = 0;
{
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_0 = ___lhs0;
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_1 = L_0.get_target_0();
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_2 = ___rhs1;
GameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F * L_3 = L_2.get_target_0();
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_4 = Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C(L_1, L_3, /*hidden argument*/NULL);
if (!L_4)
{
goto IL_0027;
}
}
{
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_5 = ___lhs0;
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_6 = L_5.get_camera_1();
HitInfo_t2B010E637D28B522E704FDA56FAE6DA9979D8746 L_7 = ___rhs1;
Camera_t48B2B9ECB3CE6108A98BF949A1CECF0FE3421F34 * L_8 = L_7.get_camera_1();
IL2CPP_RUNTIME_CLASS_INIT(Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0_il2cpp_TypeInfo_var);
bool L_9 = Object_op_Equality_mBC2401774F3BE33E8CF6F0A8148E66C95D6CFF1C(L_6, L_8, /*hidden argument*/NULL);
G_B3_0 = ((int32_t)(L_9));
goto IL_0028;
}
IL_0027:
{
G_B3_0 = 0;
}
IL_0028:
{
V_0 = (bool)G_B3_0;
goto IL_002b;
}
IL_002b:
{
bool L_10 = V_0;
return L_10;
}
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Int32 UnityEngine.Touch::get_fingerId()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Touch_get_fingerId_m2EF0EF2E6E388C8D9D38C58EF5D03EA30E568E1D (Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * __this, const RuntimeMethod* method)
{
int32_t V_0 = 0;
{
int32_t L_0 = __this->get_m_FingerId_0();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
int32_t L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C int32_t Touch_get_fingerId_m2EF0EF2E6E388C8D9D38C58EF5D03EA30E568E1D_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * _thisAdjusted = reinterpret_cast<Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 *>(__this + _offset);
return Touch_get_fingerId_m2EF0EF2E6E388C8D9D38C58EF5D03EA30E568E1D(_thisAdjusted, method);
}
// UnityEngine.Vector2 UnityEngine.Touch::get_position()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR Vector2_tA85D2DD88578276CA8A8796756458277E72D073D Touch_get_position_m2E60676112DA3628CF2DC76418A275C7FE521D8F (Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * __this, const RuntimeMethod* method)
{
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D V_0;
memset((&V_0), 0, sizeof(V_0));
{
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_0 = __this->get_m_Position_1();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
Vector2_tA85D2DD88578276CA8A8796756458277E72D073D L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C Vector2_tA85D2DD88578276CA8A8796756458277E72D073D Touch_get_position_m2E60676112DA3628CF2DC76418A275C7FE521D8F_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * _thisAdjusted = reinterpret_cast<Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 *>(__this + _offset);
return Touch_get_position_m2E60676112DA3628CF2DC76418A275C7FE521D8F(_thisAdjusted, method);
}
// UnityEngine.TouchPhase UnityEngine.Touch::get_phase()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Touch_get_phase_m759A61477ECBBD90A57E36F1166EB9340A0FE349 (Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * __this, const RuntimeMethod* method)
{
int32_t V_0 = 0;
{
int32_t L_0 = __this->get_m_Phase_6();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
int32_t L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C int32_t Touch_get_phase_m759A61477ECBBD90A57E36F1166EB9340A0FE349_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * _thisAdjusted = reinterpret_cast<Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 *>(__this + _offset);
return Touch_get_phase_m759A61477ECBBD90A57E36F1166EB9340A0FE349(_thisAdjusted, method);
}
// UnityEngine.TouchType UnityEngine.Touch::get_type()
IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR int32_t Touch_get_type_mAF919D12756ABA000A17146E82FDDFCEBFD6EEA9 (Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * __this, const RuntimeMethod* method)
{
int32_t V_0 = 0;
{
int32_t L_0 = __this->get_m_Type_7();
V_0 = L_0;
goto IL_000a;
}
IL_000a:
{
int32_t L_1 = V_0;
return L_1;
}
}
IL2CPP_EXTERN_C int32_t Touch_get_type_mAF919D12756ABA000A17146E82FDDFCEBFD6EEA9_AdjustorThunk (RuntimeObject * __this, const RuntimeMethod* method)
{
int32_t _offset = 1;
Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 * _thisAdjusted = reinterpret_cast<Touch_tAACD32535FF3FE5DD91125E0B6987B93C68D2DE8 *>(__this + _offset);
return Touch_get_type_mAF919D12756ABA000A17146E82FDDFCEBFD6EEA9(_thisAdjusted, method);
}
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| [
"danielgnewsom@gmail.com"
] | danielgnewsom@gmail.com |
fa8972ea58ac4218f1b05e194da81bf003159f47 | d42abb97ac439e579add5f01623b67c5b6126382 | /application.cpp | 3ce3e62e085e1d2918011414716a0b3214c1c843 | [] | no_license | TP1997/Sort-visualiser | e756c86336c6e11130718a5c7050845d8bda3283 | fe649d2ddeb90a525953416a5540b2dd22018cb2 | refs/heads/master | 2020-04-21T23:03:22.303340 | 2019-03-11T02:00:09 | 2019-03-11T02:00:09 | 169,931,697 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,325 | cpp | #include "application.h"
#include "algorithms.h"
#include <iostream>
Application::Application(sf::RenderWindow &window, int w, int h):
m_window(window),
scrW(w), scrH(h),
m_Array(window){
}
Application::~Application(){
}
void Application::mainloop(){
m_window.setFramerateLimit(60);
m_window.clear();
m_window.setVisible(false);
bool exit=false;
while(!exit){
std::cout << "Commands:" << std::endl;
std::cout << "1 -> [exit]" << std::endl;
std::cout << "2 -> [run]" << std::endl;
std::string command;
std::cin >> command;
switch(castInteger(command)){
case(1):
exit=true;
break;
case(2):
runVisualization();
break;
default:
std::cout << "Invalid input!" << std::endl;
std::cin.clear();
std::cin.ignore(INT_MAX, '\n');
}
}
}
int Application::castInteger(std::string value){
return atoi(value.c_str());
}
int Application::readInteger()throw(const char*){
int command;
if(!(std::cin >> command)){
std::cin.clear();
std::cin.ignore();
throw "Invalid command!";
}
return command;
}
int Application::readCommand(){
try{
int value=readInteger();
return value;
}
catch(const char* msg){
std::cout << msg << std::endl;
return 0;
}
}
void Application::runVisualization(){
std::cout << "Select algorithm:" << std::endl;
std::cout << "1 -> [bubble sort]" << std::endl;
std::cout << "2 -> [insertion sort]" << std::endl;
std::cout << "3 -> [selection sort]" << std::endl;
std::cout << "4 -> [merge sort]" << std::endl;
std::cout << "5 -> [shell sort]" << std::endl;
std::cout << "6 -> [cocktail sort]" << std::endl;
std::cout << "7 -> [heap sort]" << std::endl;
std::cout << "8 -> [quick sort]" << std::endl;
m_Array.shuffle();
bool noAction=false;
std::string command;
std::cin >> command;
switch(castInteger(command)){
case(1):
m_window.setVisible(true);
Algorihms::bubbleSort(m_Array);
break;
case(2):
m_window.setVisible(true);
Algorihms::insertionSort(m_Array);
break;
case(3):
m_window.setVisible(true);
Algorihms::selectionSort(m_Array);
break;
case(4):
m_window.setVisible(true);
Algorihms::mergeSort(m_Array);
break;
case(5):
m_window.setVisible(true);
Algorihms::shellSort(m_Array);
break;
case(6):
m_window.setVisible(true);
Algorihms::cocktailSort(m_Array);
break;
case(7):
m_window.setVisible(true);
Algorihms::heapSort(m_Array);
break;
case(8):
m_window.setVisible(true);
Algorihms::quickSort(m_Array);
break;
default:
noAction=true;
std::cin.clear();
std::cin.ignore(INT_MAX, '\n');
}
if(!noAction){
m_Array.paint();
}
m_window.setVisible(false);
}
| [
"47488769+TP1997@users.noreply.github.com"
] | 47488769+TP1997@users.noreply.github.com |
7b06c6110e4ca807040157e9cb5a60bc28aada5e | eb5d15764ed4d88512d849461abbd1515b47c24c | /cryptonote/src/PaymentGate/PaymentServiceJsonRpcMessages.h | 92bc9a9d09f9cece85cecae64e8e97ff7883f81b | [
"LGPL-3.0-only",
"GPL-3.0-only"
] | permissive | theboldtoken/bold | 4e74e2ef43f103ad8795892450918399030b32db | 3015bc90fedebec106ff28f0d49ea72d147a98fe | refs/heads/master | 2020-03-22T00:01:22.499231 | 2019-09-29T05:48:10 | 2019-09-29T05:48:10 | 117,006,837 | 0 | 1 | MIT | 2018-01-10T22:47:39 | 2018-01-10T20:24:35 | null | UTF-8 | C++ | false | false | 8,941 | h | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers
//
// This file is part of Bytecoin.
//
// Bytecoin is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Bytecoin is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Bytecoin. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <exception>
#include <limits>
#include <vector>
#include "Serialization/ISerializer.h"
namespace PaymentService {
const uint32_t DEFAULT_ANONYMITY_LEVEL = 6;
class RequestSerializationError: public std::exception {
public:
virtual const char* what() const throw() override { return "Request error"; }
};
struct Save {
struct Request {
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct Export {
struct Request {
std::string fileName;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct Reset {
struct Request {
std::string viewSecretKey;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct GetViewKey {
struct Request {
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::string viewSecretKey;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct GetStatus {
struct Request {
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
uint32_t blockCount;
uint32_t knownBlockCount;
std::string lastBlockHash;
uint32_t peerCount;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct GetAddresses {
struct Request {
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::vector<std::string> addresses;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct CreateAddress {
struct Request {
std::string spendSecretKey;
std::string spendPublicKey;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::string address;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct CreateAddressList {
struct Request {
std::vector<std::string> spendSecretKeys;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::vector<std::string> addresses;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct DeleteAddress {
struct Request {
std::string address;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct GetSpendKeys {
struct Request {
std::string address;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::string spendSecretKey;
std::string spendPublicKey;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct GetBalance {
struct Request {
std::string address;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
uint64_t availableBalance;
uint64_t lockedAmount;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct GetBlockHashes {
struct Request {
uint32_t firstBlockIndex;
uint32_t blockCount;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::vector<std::string> blockHashes;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct TransactionHashesInBlockRpcInfo {
std::string blockHash;
std::vector<std::string> transactionHashes;
void serialize(CryptoNote::ISerializer& serializer);
};
struct GetTransactionHashes {
struct Request {
std::vector<std::string> addresses;
std::string blockHash;
uint32_t firstBlockIndex = std::numeric_limits<uint32_t>::max();
uint32_t blockCount;
std::string paymentId;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::vector<TransactionHashesInBlockRpcInfo> items;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct TransferRpcInfo {
uint8_t type;
std::string address;
int64_t amount;
void serialize(CryptoNote::ISerializer& serializer);
};
struct TransactionRpcInfo {
uint8_t state;
std::string transactionHash;
uint32_t blockIndex;
uint64_t timestamp;
bool isBase;
uint64_t unlockTime;
int64_t amount;
uint64_t fee;
std::vector<TransferRpcInfo> transfers;
std::string extra;
std::string paymentId;
void serialize(CryptoNote::ISerializer& serializer);
};
struct GetTransaction {
struct Request {
std::string transactionHash;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
TransactionRpcInfo transaction;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct TransactionsInBlockRpcInfo {
std::string blockHash;
std::vector<TransactionRpcInfo> transactions;
void serialize(CryptoNote::ISerializer& serializer);
};
struct GetTransactions {
struct Request {
std::vector<std::string> addresses;
std::string blockHash;
uint32_t firstBlockIndex = std::numeric_limits<uint32_t>::max();
uint32_t blockCount;
std::string paymentId;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::vector<TransactionsInBlockRpcInfo> items;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct GetUnconfirmedTransactionHashes {
struct Request {
std::vector<std::string> addresses;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::vector<std::string> transactionHashes;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct WalletRpcOrder {
std::string address;
uint64_t amount;
void serialize(CryptoNote::ISerializer& serializer);
};
struct SendTransaction {
struct Request {
std::vector<std::string> sourceAddresses;
std::vector<WalletRpcOrder> transfers;
std::string changeAddress;
uint64_t fee = 0;
uint32_t anonymity = DEFAULT_ANONYMITY_LEVEL;
std::string extra;
std::string paymentId;
uint64_t unlockTime = 0;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::string transactionHash;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct CreateDelayedTransaction {
struct Request {
std::vector<std::string> addresses;
std::vector<WalletRpcOrder> transfers;
std::string changeAddress;
uint64_t fee = 0;
uint32_t anonymity = DEFAULT_ANONYMITY_LEVEL;
std::string extra;
std::string paymentId;
uint64_t unlockTime = 0;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::string transactionHash;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct GetDelayedTransactionHashes {
struct Request {
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::vector<std::string> transactionHashes;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct DeleteDelayedTransaction {
struct Request {
std::string transactionHash;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct SendDelayedTransaction {
struct Request {
std::string transactionHash;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct SendFusionTransaction {
struct Request {
uint64_t threshold;
uint32_t anonymity = DEFAULT_ANONYMITY_LEVEL;
std::vector<std::string> addresses;
std::string destinationAddress;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
std::string transactionHash;
void serialize(CryptoNote::ISerializer& serializer);
};
};
struct EstimateFusion {
struct Request {
uint64_t threshold;
std::vector<std::string> addresses;
void serialize(CryptoNote::ISerializer& serializer);
};
struct Response {
uint32_t fusionReadyCount;
uint32_t totalOutputCount;
void serialize(CryptoNote::ISerializer& serializer);
};
};
} //namespace PaymentService
| [
"dev1@boldtoken.io"
] | dev1@boldtoken.io |
2f47d9ee4274c84673f125c05a7ad273fe65bc5c | 565f9938fcef5d8e277bbc448d22f60e05ef69a9 | /Object-Oriented-Programming with C++ 2(OOP345)/Labs/WS02/at_home/Timekeeper.cpp | f1d6aa8c4e75aaee0aa99ef78733fedee40c42c1 | [] | no_license | Sandro927/School-Work | 9165a68e11f99960c99864d48e3640cfb611e8b7 | 7c50585fec1691f7ac0d18ea21087514216d590f | refs/heads/main | 2023-02-16T07:38:11.295116 | 2021-01-13T21:20:43 | 2021-01-13T21:20:43 | 329,430,279 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 914 | cpp | /*Alejandro Mandala 036870111
amandala@myseneca.ca
Workshop 2 in lab
*/
#include <iostream>
#include <iomanip>
#include <chrono>
#include "Timekeeper.h"
namespace sict {
Timekeeper::Timekeeper() : tstart{}, tend{}, counter{ 0 } { }
void Timekeeper::start() { tstart = std::chrono::steady_clock::now(); }
void Timekeeper::stop() { tend = std::chrono::steady_clock::now(); }
void Timekeeper::recordEvent(const char *description) {
auto start = tstart;
auto end = tend;
if (counter < max) {
record[counter].message = description;
record[counter].duration = end - start;
counter++;
}
}
void Timekeeper::report(std::ostream &os) {
os << "\nExecution Times:" << std::endl;
for (size_t i = 0; i < counter; ++i)
os << record[i].message << std::setw(6) << std::chrono::duration_cast<std::chrono::milliseconds>(record[i].duration).count() << " " << record[i].units << std::endl;
}
} | [
"47231162+Sandro927@users.noreply.github.com"
] | 47231162+Sandro927@users.noreply.github.com |
a8b8f372c7d8888401eae4b67c991d24b3d10213 | db05cb6d4b51c02db267a0ab54c23014b4afb915 | /Part3/Proj3/recommendation.cc | 02ff4c99fd534be038fcfdba1c7469f616ced6b6 | [] | no_license | apof/Recommendation-System-based-on-Lsh-and-Clustering-Projects | 465b1526188e32afccd040050bfd35f9635e9c98 | ebbce052671de6087a7414ad93ecf1b57bb98afe | refs/heads/master | 2020-04-14T02:05:00.356864 | 2019-11-12T15:02:01 | 2019-11-12T15:02:01 | 163,575,900 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,975 | cc | #include "tweets_preproc.h"
#include "recomm_methods.h"
int K;
int main(int argc, char** argv){
srand(time(NULL));
// default k,l values
K=4;
int l=5;
int cluster_num;
int Recommendation;
string config_file = argv[8];
ifstream configfile(config_file);
char buffer[12000];
while (configfile.getline(buffer, sizeof(buffer)))
{
char* pch = strtok(buffer," ");
if(strcmp(pch,"Recommendation:")==0)
{
pch = strtok(NULL," ");
Recommendation = atoi(pch);
}
else if(strcmp(pch,"cluster_num:")==0)
{
pch = strtok(NULL," ");
cluster_num = atoi(pch);
}
}
//cout<<Recommendation<<" "<<cluster_num<<endl;
string input_file = argv[2];
string input_flags = argv[4];
string output_file = argv[6];
ifstream inputfile(input_file);
ifstream flagsfile(input_flags);
MyVector** vec_pointers = new MyVector*[TOTAL_DATA_NUMBER];
for(int i=0; i<TOTAL_DATA_NUMBER; i++)
vec_pointers[i] = NULL;
int data_index = -1;
string* coin_array = new string[COIN_NUMBER];
while (inputfile.getline(buffer, sizeof(buffer)))
{
if(data_index == -1)
{
int coin_index = 0;
char* pch = strtok(buffer,"\t");
pch = strtok(NULL,"\t");
pch = strtok(NULL,"\t");
while(pch!=NULL){
string str(pch);
coin_array[coin_index] = str;
coin_index++;
pch = strtok(NULL,"\t");
}
}
else
{
string id = to_string(data_index);
id = "ID"+id;
string type("double");
vec_pointers[data_index] = new MyVector(type,id);
vec_pointers[data_index]->intVectorInitialization(buffer);
}
data_index++;
}
data_index = 0;
while (flagsfile.getline(buffer, sizeof(buffer)))
{
int* flag = new int[COIN_NUMBER];
int flag_index = 0;
char* pch = strtok(buffer,"\t");
while(pch!=NULL)
{
flag[flag_index] = atoi(pch);
flag_index++;
pch = strtok(NULL,"\t");
}
vec_pointers[data_index]->set_flag(flag);
data_index++;
}
/*for(int i=0; i<DATA_NUMBER; i++)
vec_pointers[i]->PrintVector();
for(int i=0; i<COIN_NUMBER; i++)
cout<<coin_array[i]<<endl;
*/
if(Recommendation==1)
{
string str = "cosine";
char *cstr = new char[str.length() + 1];
strcpy(cstr, str.c_str());
if(argc!=10)
recommendation_based_on_lsh(vec_pointers,l,cstr,coin_array,output_file);
else
validation_on_lsh(vec_pointers,l,cstr);
delete []cstr;
}
else if(Recommendation==2)
{
string str = "eucledian";
char *cstr = new char[str.length() + 1];
strcpy(cstr, str.c_str());
if(argc!=10)
recommendation_based_on_clustering(vec_pointers,l,cstr,coin_array,output_file,cluster_num,1,1,1);
else
validation_on_clustering_new(vec_pointers,l,cstr,cluster_num,1,1,1);
delete []cstr;
}
for(int i=0; i<TOTAL_DATA_NUMBER; i++)
if(vec_pointers[i]!=NULL) { delete vec_pointers[i]; vec_pointers[i] = NULL; }
delete []vec_pointers;
inputfile.close();
flagsfile.close();
configfile.close();
return 0;
} | [
"noreply@github.com"
] | noreply@github.com |
1a360d9610f428b789203f0bdff48739871bfa9e | dabe8f32d71a9a3b61ebcb1f2eb021b5d5dc9885 | /io/file/Path.h | 2fa1fef0615a4affea204bb79ce47692d05eaae8 | [
"LicenseRef-scancode-public-domain"
] | permissive | jasonrohrer/minorGems | f14f4f5788dd7334db23966558869106ce6de1b2 | 021dc2e55664fff800299de7b80f5df5bafd6635 | refs/heads/master | 2023-09-01T04:34:40.693806 | 2023-08-10T15:52:16 | 2023-08-10T15:52:16 | 106,723,252 | 30 | 63 | NOASSERTION | 2023-09-02T11:21:22 | 2017-10-12T17:17:54 | C++ | UTF-8 | C++ | false | false | 15,207 | h | /*
* Modification History
*
* 2001-February-12 Jason Rohrer
* Created.
*
* 2001-May-11 Jason Rohrer
* Added a version of getPathString that
* returns a '\0' terminated string.
*
* 2001-September-21 Jason Rohrer
* Added a missing include.
*
* 2001-September-23 Jason Rohrer
* Added a copy function.
* Made some comments more explicit.
* Changed the constructor to allow for const path step strings.
*
* 2001-November-3 Jason Rohrer
* Added a function for appending a string to a path.
* Changed the interface to the main constructor.
*
* 2002-March-29 Jason Rohrer
* Added Fortify inclusion.
*
* 2002-April-11 Jason Rohrer
* Fixed a variable scoping bug.
*
* 2002-July-2 Jason Rohrer
* Fixed a major memory leak in copy().
*
* 2002-August-1 Jason Rohrer
* Added support for path truncation.
* Added support for parsing platform-dependent path strings.
*
* 2003-May-29 Jason Rohrer
* Fixed a bug when an extra delimeters are at the end of the path.
* Fixed a bug when string path consists only of root.
*
* 2003-June-2 Jason Rohrer
* Fixed a bug in absolute path detection.
* Added platform-specific functions for root and absolute path detection.
* Fixed a memory bug when string path contains root only.
* Fixed a path step bug when path is root.
* Fixed bugs in truncate and append when non-default root string is used.
*
* 2005-August-29 Jason Rohrer
* Fixed an uninitialized variable warning.
*
* 2010-May-14 Jason Rohrer
* String parameters as const to fix warnings.
*
* 2011-March-9 Jason Rohrer
* Removed Fortify inclusion.
*/
#include "minorGems/common.h"
#ifndef PATH_CLASS_INCLUDED
#define PATH_CLASS_INCLUDED
#include <string.h>
#include "minorGems/util/stringUtils.h"
/**
* Platform-independent file path interface. Contains
* all of path except for file name. Thus, appending
* a file name to the path will produce a complete file path.
*
* E.g., on Linux, file path:
* temp/files/
* file name:
* test.txt
* full path:
* temp/files/test.txt
*
* @author Jason Rohrer
*/
class Path {
public:
/**
* Constructs a path.
*
* @param inPathSteps an array of c-strings representing
* each step in the path, with no delimeters.
* For example, { "temp", "files" } to represent
* the linux path temp/files.
* Must be destroyed by caller since copied internally.
* @param inNumSteps the number of strings in the path.
* @param inAbsolute set to true to make this an absolute
* path. For example, in Linux, an absolute path
* is one that starts with '/', as in /usr/include/.
* The effects of inAbsolute vary by platform.
* @param inRootString the root string for this path if it
* is absolute, or NULL to specify a default root.
* Defaults to NULL.
* Must be destroyed by caller if non-NULL.
*/
Path( char **inPathSteps, int inNumSteps, char inAbsolute,
char *inRootString = NULL );
/**
* Constructs a path by parsing a platform-dependent path string.
*
* @param inPathSteps a \0-terminated string representing the path.
* Must be destroyed by caller.
*/
Path( const char *inPathString );
~Path();
/**
* Returns a complete, platform-dependent string path.
*
* @param outLength pointer to where the path length, in
* characters, will be returned.
*
* @return a new char array containing the path. Note
* that the string is not terminated by '\0'. Must
* be destroyed by the caller.
*/
char *getPathString( int *outLength );
/**
* Returns a complete, platform-dependent string path, terminated
* bye '\0'.
*
* @return a new char array containing the path. Note
* that the string IS terminated by '\0'. Must
* be destroyed by the caller.
*/
char *getPathStringTerminated();
/**
* Gets the platform-specific path delimeter.
*
* Note that this function is implemented separately for
* each supported platform.
*
* @return the path delimeter.
*/
static char getDelimeter();
/**
* Gets start characters for an absolute path.
*
* Note that this function is implemented separately for
* each supported platform.
*
* @param outLength pointer to where the string length, in
* characters, will be returned.
*
* @return the absolute path start string characters. For
* example, on Linux, this would be the string "/".
* Must be destroyed by the caller.
*/
static char *getAbsoluteRoot( int *outLength );
/**
* Gets whether a path string is absolute.
*
* Note that this function is implemented separately for
* each supported platform.
*
* @param inPathString the string to check.
* Must be destroyed by caller if non-const.
*
* @return true if the string is absolute, or false otherwise.
*/
static char isAbsolute( const char *inPathString );
/**
* Extracts the root string from a path string.
*
*
* @param inPathString the string to check.
* Must be destroyed by caller if non-const.
*
* @return the root string, or NULL if inPathString is not
* absolute. Must be destroyed by caller if non-NULL.
*/
static char *extractRoot( const char *inPathString );
/**
* Gets whether a path string is a root path.
*
* Note that this function is implemented separately for
* each supported platform. For example, on Unix, only "/"
* is the root path, while on Windows, both "c:\" and "d:\" might
* be root paths.
*
* @param inPathString the string to check.
* Must be destroyed by caller if non-const.
*
* @return true if the string is a root string, or false otherwise.
*/
static char isRoot( const char *inPathString );
/**
* Gets start string for an absolute path.
*
* @return the absolute path start string in \0-terminated form.
* Must be destroyed by the caller.
*/
static char *getAbsoluteRootString();
/**
* Copies this path.
*
* @return a new path that is a deep copy of this path.
*/
Path *copy();
/**
* Constructs a new path by appending an additional
* step onto this path.
*
* @param inStepString the step to add to this path.
* Must be destroyed by caller if non-const.
*
* @return a new path with the extra step.
* Must be destroyed by caller.
*/
Path *append( const char *inStepString );
/**
* Constructs a new path by removing the last step from this path.
*
* @return a new path, or NULL if there is only one step in this path.
* Must be destroyed by caller.
*/
Path *truncate();
/**
* Gets the last step in this path.
*
* @return the last step. Must be destroyed by caller.
*/
char *getLastStep();
private:
char **mPathSteps;
int mNumSteps;
int *mStepLength;
char mAbsolute;
// the root string of this path, if it is absolute
char *mRootString;
};
inline Path::Path( char **inPathSteps, int inNumSteps,
char inAbsolute, char *inRootString )
: mNumSteps( inNumSteps ), mAbsolute( inAbsolute ),
mRootString( NULL ) {
if( inRootString != NULL ) {
mRootString = stringDuplicate( inRootString );
}
// copy the path steps
mPathSteps = new char*[ mNumSteps ];
mStepLength = new int[ mNumSteps ];
for( int i=0; i<mNumSteps; i++ ) {
int stepLength = strlen( inPathSteps[i] );
mPathSteps[i] = new char[ stepLength + 1 ];
memcpy( mPathSteps[i], inPathSteps[i], stepLength + 1 );
mStepLength[i] = stepLength;
}
}
inline Path::Path( const char *inPathString ) {
mAbsolute = isAbsolute( inPathString );
char *pathStringCopy = stringDuplicate( inPathString );
char delimeter = getDelimeter();
char *delimString = new char[ 2 ];
delimString[0] = delimeter;
delimString[1] = '\0';
char *pathRootSkipped;
if( !mAbsolute ) {
mRootString = NULL;
pathRootSkipped = pathStringCopy;
}
else {
// root occurs at start of path string
mRootString = extractRoot( inPathString );
pathRootSkipped = &( pathStringCopy[ strlen( mRootString ) ] );
}
// remove any trailing delimeters, if they exist
while( pathRootSkipped[ strlen( pathRootSkipped ) - 1 ] == delimeter ) {
pathRootSkipped[ strlen( pathRootSkipped ) - 1 ] = '\0';
}
char *currentDelimPointer = strstr( pathRootSkipped, delimString );
if( currentDelimPointer != NULL ) {
// first, count the delimeters
int delimCount = 0;
while( currentDelimPointer != NULL ) {
if( strlen( currentDelimPointer ) > 1 ) {
// don't count tail end delimeters
delimCount++;
}
currentDelimPointer = strstr( &( currentDelimPointer[1] ),
delimString );
}
// no delimeter at end of path
mNumSteps = delimCount + 1;
mPathSteps = new char*[ mNumSteps ];
mStepLength = new int[ mNumSteps ];
// now extract the chars between delimeters as path steps
currentDelimPointer = strstr( pathRootSkipped, delimString );
int stepIndex = 0;
currentDelimPointer[0] = '\0';
mPathSteps[ stepIndex ] = stringDuplicate( pathRootSkipped );
mStepLength[ stepIndex ] = strlen( mPathSteps[ stepIndex ] );
stepIndex++;
while( currentDelimPointer != NULL ) {
char *nextDelimPointer = strstr( &( currentDelimPointer[1] ),
delimString );
if( nextDelimPointer != NULL ) {
nextDelimPointer[0] = '\0';
}
mPathSteps[ stepIndex ] =
stringDuplicate( &( currentDelimPointer[1] ) );
mStepLength[ stepIndex ] = strlen( mPathSteps[ stepIndex ] );
stepIndex++;
currentDelimPointer = nextDelimPointer;
}
}
else {
// no delimeters
if( strlen( pathRootSkipped ) > 0 ) {
mNumSteps = 1;
mPathSteps = new char*[1];
mPathSteps[0] = stringDuplicate( pathRootSkipped );
mStepLength = new int[1];
mStepLength[0] = strlen( mPathSteps[0] );
}
else {
// path with root only
mNumSteps = 0;
mPathSteps = new char*[0];
mStepLength = new int[0];
}
}
delete [] delimString;
delete [] pathStringCopy;
}
inline Path::~Path() {
// delete each step
for( int i=0; i<mNumSteps; i++ ) {
delete [] mPathSteps[i];
}
delete [] mPathSteps;
delete [] mStepLength;
if( mRootString != NULL ) {
delete [] mRootString;
}
}
inline char *Path::getPathString( int *outLength ) {
int length = 0;
// length = sum( length each step string + 1 )
// ( + 1 is for the delimeter that occurs after each step string )
int i;
for( i=0; i<mNumSteps; i++ ) {
length += mStepLength[i] + 1;
}
// if absolute, we need to add in the length of the root
char *rootString = NULL;
int rootLength = 0;
if( mAbsolute ) {
if( mRootString != NULL ) {
rootString = stringDuplicate( mRootString );
rootLength = strlen( mRootString );
}
else {
rootString = getAbsoluteRoot( &rootLength );
}
length += rootLength;
}
char *returnString = new char[ length ];
int index = 0;
if( rootString != NULL ) {
// write root into string
memcpy( &( returnString[index] ), rootString, rootLength );
index += rootLength;
delete [] rootString;
}
char delimeter = getDelimeter();
// write each step into the string
for( i=0; i<mNumSteps; i++ ) {
memcpy( &( returnString[index] ), mPathSteps[i], mStepLength[i] );
index += mStepLength[i];
returnString[ index ] = delimeter;
index++;
}
*outLength = length;
return returnString;
}
inline char *Path::getPathStringTerminated() {
int length;
char *pathString = getPathString( &length );
char *delimitedPathString = new char[ length + 1 ];
memcpy( delimitedPathString, pathString, length );
delimitedPathString[ length ] = '\0';
delete [] pathString;
return delimitedPathString;
}
inline Path *Path::copy() {
// the steps will be copied internally
return new Path( mPathSteps, mNumSteps, mAbsolute, mRootString );
}
inline Path *Path::append( const char *inStepString ) {
char **newPathSteps = new char*[ mNumSteps + 1 ];
// shallow copy, since the strings themselves
// are copied in the Path constructor below
for( int i=0; i<mNumSteps; i++ ) {
newPathSteps[i] = mPathSteps[i];
}
// append final step
newPathSteps[ mNumSteps ] = (char*)inStepString;
Path *newPath = new Path( newPathSteps, mNumSteps + 1, mAbsolute,
mRootString );
// shallow delete, because of shallow copy above
delete [] newPathSteps;
return newPath;
}
inline Path *Path::truncate() {
if( mNumSteps < 2 && !mAbsolute ) {
return NULL;
}
else if( mNumSteps < 1 ) {
return NULL;
}
char **newPathSteps = new char*[ mNumSteps ];
// shallow copy, since the strings themselves
// are copied in the Path constructor below
for( int i=0; i<mNumSteps-1; i++ ) {
newPathSteps[i] = mPathSteps[i];
}
Path *newPath = new Path( newPathSteps, mNumSteps - 1, mAbsolute,
mRootString );
// shallow delete, because of shallow copy above
delete [] newPathSteps;
return newPath;
}
inline char *Path::getLastStep() {
if( mNumSteps >= 1 ) {
return stringDuplicate( mPathSteps[ mNumSteps - 1 ] );
}
else {
if( mAbsolute ) {
if( mRootString != NULL ) {
return stringDuplicate( mRootString );
}
else {
return getAbsoluteRootString();
}
}
else {
// no path steps and not absolute...
return stringDuplicate( "" );
}
}
}
inline char *Path::getAbsoluteRootString() {
int rootLength;
char *root = getAbsoluteRoot( &rootLength );
char *rootString = new char[ rootLength + 1 ];
strncpy( rootString, root, rootLength );
// strncopy won't add termination if length limit reached
rootString[ rootLength ] = '\0';
delete [] root;
return rootString;
}
#endif
| [
"jasonrohrer@fastmail.fm"
] | jasonrohrer@fastmail.fm |
2e6788ed7d67d371b01c25dff429d66f0aed8d46 | 6b832f63490877edbe372565d3474b3b34a48610 | /external/src/imgui/imgui_impl_sdl_gl3.cpp | 90a643ba74d02d0c62c4b1bc29178531756165c6 | [
"MIT"
] | permissive | kretash/Shadershop | 8e75c52dc8bcaa9ca2f3d1f58bce410eca245f51 | b8c57533d1e3ce1363c24fa137ee41ee15d92508 | refs/heads/master | 2021-07-03T06:41:07.691014 | 2017-09-24T15:56:28 | 2017-09-24T15:56:28 | 104,656,805 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,648 | cpp | // ImGui SDL2 binding with OpenGL3
// In this binding, ImTextureID is used to store an OpenGL 'GLuint' texture identifier. Read the FAQ about ImTextureID in imgui.cpp.
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown().
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// https://github.com/ocornut/imgui
#include "imgui/imgui.h"
#include "imgui/imgui_impl_sdl_gl3.h"
// SDL,GL3W
#include "SDL2/SDL.h"
#include "SDL2/SDL_syswm.h"
#include "GL/glew.h"
// Data
static double g_Time = 0.0f;
static bool g_MousePressed[3] = { false, false, false };
static float g_MouseWheel = 0.0f;
static GLuint g_FontTexture = 0;
static int g_ShaderHandle = 0, g_VertHandle = 0, g_FragHandle = 0;
static int g_AttribLocationTex = 0, g_AttribLocationProjMtx = 0;
static int g_AttribLocationPosition = 0, g_AttribLocationUV = 0, g_AttribLocationColor = 0;
static unsigned int g_VboHandle = 0, g_VaoHandle = 0, g_ElementsHandle = 0;
// This is the main rendering function that you have to implement and provide to ImGui (via setting up 'RenderDrawListsFn' in the ImGuiIO structure)
// If text or lines are blurry when integrating ImGui in your engine:
// - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f)
void ImGui_ImplSdlGL3_RenderDrawLists(ImDrawData* draw_data)
{
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
ImGuiIO& io = ImGui::GetIO();
int fb_width = (int)(io.DisplaySize.x * io.DisplayFramebufferScale.x);
int fb_height = (int)(io.DisplaySize.y * io.DisplayFramebufferScale.y);
if (fb_width == 0 || fb_height == 0)
return;
draw_data->ScaleClipRects(io.DisplayFramebufferScale);
// Backup GL state
GLint last_program; glGetIntegerv(GL_CURRENT_PROGRAM, &last_program);
GLint last_texture; glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
GLint last_active_texture; glGetIntegerv(GL_ACTIVE_TEXTURE, &last_active_texture);
GLint last_array_buffer; glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &last_array_buffer);
GLint last_element_array_buffer; glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING, &last_element_array_buffer);
GLint last_vertex_array; glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &last_vertex_array);
GLint last_blend_src; glGetIntegerv(GL_BLEND_SRC, &last_blend_src);
GLint last_blend_dst; glGetIntegerv(GL_BLEND_DST, &last_blend_dst);
GLint last_blend_equation_rgb; glGetIntegerv(GL_BLEND_EQUATION_RGB, &last_blend_equation_rgb);
GLint last_blend_equation_alpha; glGetIntegerv(GL_BLEND_EQUATION_ALPHA, &last_blend_equation_alpha);
GLint last_viewport[4]; glGetIntegerv(GL_VIEWPORT, last_viewport);
GLint last_scissor_box[4]; glGetIntegerv(GL_SCISSOR_BOX, last_scissor_box);
GLboolean last_enable_blend = glIsEnabled(GL_BLEND);
GLboolean last_enable_cull_face = glIsEnabled(GL_CULL_FACE);
GLboolean last_enable_depth_test = glIsEnabled(GL_DEPTH_TEST);
GLboolean last_enable_scissor_test = glIsEnabled(GL_SCISSOR_TEST);
// Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled
glEnable(GL_BLEND);
glBlendEquation(GL_FUNC_ADD);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glEnable(GL_SCISSOR_TEST);
glActiveTexture(GL_TEXTURE0);
// Setup orthographic projection matrix
glViewport(0, 0, (GLsizei)fb_width, (GLsizei)fb_height);
const float ortho_projection[4][4] =
{
{ 2.0f/io.DisplaySize.x, 0.0f, 0.0f, 0.0f },
{ 0.0f, 2.0f/-io.DisplaySize.y, 0.0f, 0.0f },
{ 0.0f, 0.0f, -1.0f, 0.0f },
{-1.0f, 1.0f, 0.0f, 1.0f },
};
glUseProgram(g_ShaderHandle);
glUniform1i(g_AttribLocationTex, 0);
glUniformMatrix4fv(g_AttribLocationProjMtx, 1, GL_FALSE, &ortho_projection[0][0]);
glBindVertexArray(g_VaoHandle);
for (int n = 0; n < draw_data->CmdListsCount; n++)
{
const ImDrawList* cmd_list = draw_data->CmdLists[n];
const ImDrawIdx* idx_buffer_offset = 0;
glBindBuffer(GL_ARRAY_BUFFER, g_VboHandle);
glBufferData(GL_ARRAY_BUFFER, (GLsizeiptr)cmd_list->VtxBuffer.Size * sizeof(ImDrawVert), (GLvoid*)cmd_list->VtxBuffer.Data, GL_STREAM_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, g_ElementsHandle);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, (GLsizeiptr)cmd_list->IdxBuffer.Size * sizeof(ImDrawIdx), (GLvoid*)cmd_list->IdxBuffer.Data, GL_STREAM_DRAW);
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
{
const ImDrawCmd* pcmd = &cmd_list->CmdBuffer[cmd_i];
if (pcmd->UserCallback)
{
pcmd->UserCallback(cmd_list, pcmd);
}
else
{
glBindTexture(GL_TEXTURE_2D, (GLuint)(intptr_t)pcmd->TextureId);
glScissor((int)pcmd->ClipRect.x, (int)(fb_height - pcmd->ClipRect.w), (int)(pcmd->ClipRect.z - pcmd->ClipRect.x), (int)(pcmd->ClipRect.w - pcmd->ClipRect.y));
glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer_offset);
}
idx_buffer_offset += pcmd->ElemCount;
}
}
// Restore modified GL state
glUseProgram(last_program);
glActiveTexture(last_active_texture);
glBindTexture(GL_TEXTURE_2D, last_texture);
glBindVertexArray(last_vertex_array);
glBindBuffer(GL_ARRAY_BUFFER, last_array_buffer);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, last_element_array_buffer);
glBlendEquationSeparate(last_blend_equation_rgb, last_blend_equation_alpha);
glBlendFunc(last_blend_src, last_blend_dst);
if (last_enable_blend) glEnable(GL_BLEND); else glDisable(GL_BLEND);
if (last_enable_cull_face) glEnable(GL_CULL_FACE); else glDisable(GL_CULL_FACE);
if (last_enable_depth_test) glEnable(GL_DEPTH_TEST); else glDisable(GL_DEPTH_TEST);
if (last_enable_scissor_test) glEnable(GL_SCISSOR_TEST); else glDisable(GL_SCISSOR_TEST);
glViewport(last_viewport[0], last_viewport[1], (GLsizei)last_viewport[2], (GLsizei)last_viewport[3]);
glScissor(last_scissor_box[0], last_scissor_box[1], (GLsizei)last_scissor_box[2], (GLsizei)last_scissor_box[3]);
}
static const char* ImGui_ImplSdlGL3_GetClipboardText(void*)
{
return SDL_GetClipboardText();
}
static void ImGui_ImplSdlGL3_SetClipboardText(void*, const char* text)
{
SDL_SetClipboardText(text);
}
bool ImGui_ImplSdlGL3_ProcessEvent(SDL_Event* event)
{
ImGuiIO& io = ImGui::GetIO();
switch (event->type)
{
case SDL_MOUSEWHEEL:
{
if (event->wheel.y > 0)
g_MouseWheel = 1;
if (event->wheel.y < 0)
g_MouseWheel = -1;
return true;
}
case SDL_MOUSEBUTTONDOWN:
{
if (event->button.button == SDL_BUTTON_LEFT) g_MousePressed[0] = true;
if (event->button.button == SDL_BUTTON_RIGHT) g_MousePressed[1] = true;
if (event->button.button == SDL_BUTTON_MIDDLE) g_MousePressed[2] = true;
return true;
}
case SDL_TEXTINPUT:
{
io.AddInputCharactersUTF8(event->text.text);
return true;
}
case SDL_KEYDOWN:
case SDL_KEYUP:
{
int key = event->key.keysym.sym & ~SDLK_SCANCODE_MASK;
io.KeysDown[key] = (event->type == SDL_KEYDOWN);
io.KeyShift = ((SDL_GetModState() & KMOD_SHIFT) != 0);
io.KeyCtrl = ((SDL_GetModState() & KMOD_CTRL) != 0);
io.KeyAlt = ((SDL_GetModState() & KMOD_ALT) != 0);
io.KeySuper = ((SDL_GetModState() & KMOD_GUI) != 0);
return true;
}
}
return false;
}
void ImGui_ImplSdlGL3_CreateFontsTexture()
{
// Build texture atlas
ImGuiIO& io = ImGui::GetIO();
unsigned char* pixels;
int width, height;
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height); // Load as RGBA 32-bits for OpenGL3 demo because it is more likely to be compatible with user's existing shader.
// Upload texture to graphics system
GLint last_texture;
glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
glGenTextures(1, &g_FontTexture);
glBindTexture(GL_TEXTURE_2D, g_FontTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
// Store our identifier
io.Fonts->TexID = (void *)(intptr_t)g_FontTexture;
// Restore state
glBindTexture(GL_TEXTURE_2D, last_texture);
}
bool ImGui_ImplSdlGL3_CreateDeviceObjects()
{
// Backup GL state
GLint last_texture, last_array_buffer, last_vertex_array;
glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture);
glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &last_array_buffer);
glGetIntegerv(GL_VERTEX_ARRAY_BINDING, &last_vertex_array);
const GLchar *vertex_shader =
"#version 330\n"
"uniform mat4 ProjMtx;\n"
"in vec2 Position;\n"
"in vec2 UV;\n"
"in vec4 Color;\n"
"out vec2 Frag_UV;\n"
"out vec4 Frag_Color;\n"
"void main()\n"
"{\n"
" Frag_UV = UV;\n"
" Frag_Color = Color;\n"
" gl_Position = ProjMtx * vec4(Position.xy,0,1);\n"
"}\n";
const GLchar* fragment_shader =
"#version 330\n"
"uniform sampler2D Texture;\n"
"in vec2 Frag_UV;\n"
"in vec4 Frag_Color;\n"
"out vec4 Out_Color;\n"
"void main()\n"
"{\n"
" Out_Color = Frag_Color * texture( Texture, Frag_UV.st);\n"
"}\n";
g_ShaderHandle = glCreateProgram();
g_VertHandle = glCreateShader(GL_VERTEX_SHADER);
g_FragHandle = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(g_VertHandle, 1, &vertex_shader, 0);
glShaderSource(g_FragHandle, 1, &fragment_shader, 0);
glCompileShader(g_VertHandle);
glCompileShader(g_FragHandle);
glAttachShader(g_ShaderHandle, g_VertHandle);
glAttachShader(g_ShaderHandle, g_FragHandle);
glLinkProgram(g_ShaderHandle);
g_AttribLocationTex = glGetUniformLocation(g_ShaderHandle, "Texture");
g_AttribLocationProjMtx = glGetUniformLocation(g_ShaderHandle, "ProjMtx");
g_AttribLocationPosition = glGetAttribLocation(g_ShaderHandle, "Position");
g_AttribLocationUV = glGetAttribLocation(g_ShaderHandle, "UV");
g_AttribLocationColor = glGetAttribLocation(g_ShaderHandle, "Color");
glGenBuffers(1, &g_VboHandle);
glGenBuffers(1, &g_ElementsHandle);
glGenVertexArrays(1, &g_VaoHandle);
glBindVertexArray(g_VaoHandle);
glBindBuffer(GL_ARRAY_BUFFER, g_VboHandle);
glEnableVertexAttribArray(g_AttribLocationPosition);
glEnableVertexAttribArray(g_AttribLocationUV);
glEnableVertexAttribArray(g_AttribLocationColor);
#define OFFSETOF(TYPE, ELEMENT) ((size_t)&(((TYPE *)0)->ELEMENT))
glVertexAttribPointer(g_AttribLocationPosition, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid*)OFFSETOF(ImDrawVert, pos));
glVertexAttribPointer(g_AttribLocationUV, 2, GL_FLOAT, GL_FALSE, sizeof(ImDrawVert), (GLvoid*)OFFSETOF(ImDrawVert, uv));
glVertexAttribPointer(g_AttribLocationColor, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(ImDrawVert), (GLvoid*)OFFSETOF(ImDrawVert, col));
#undef OFFSETOF
ImGui_ImplSdlGL3_CreateFontsTexture();
// Restore modified GL state
glBindTexture(GL_TEXTURE_2D, last_texture);
glBindBuffer(GL_ARRAY_BUFFER, last_array_buffer);
glBindVertexArray(last_vertex_array);
return true;
}
void ImGui_ImplSdlGL3_InvalidateDeviceObjects()
{
if (g_VaoHandle) glDeleteVertexArrays(1, &g_VaoHandle);
if (g_VboHandle) glDeleteBuffers(1, &g_VboHandle);
if (g_ElementsHandle) glDeleteBuffers(1, &g_ElementsHandle);
g_VaoHandle = g_VboHandle = g_ElementsHandle = 0;
if (g_ShaderHandle && g_VertHandle) glDetachShader(g_ShaderHandle, g_VertHandle);
if (g_VertHandle) glDeleteShader(g_VertHandle);
g_VertHandle = 0;
if (g_ShaderHandle && g_FragHandle) glDetachShader(g_ShaderHandle, g_FragHandle);
if (g_FragHandle) glDeleteShader(g_FragHandle);
g_FragHandle = 0;
if (g_ShaderHandle) glDeleteProgram(g_ShaderHandle);
g_ShaderHandle = 0;
if (g_FontTexture)
{
glDeleteTextures(1, &g_FontTexture);
ImGui::GetIO().Fonts->TexID = 0;
g_FontTexture = 0;
}
}
bool ImGui_ImplSdlGL3_Init(SDL_Window* window)
{
ImGuiIO& io = ImGui::GetIO();
io.KeyMap[ImGuiKey_Tab] = SDLK_TAB; // Keyboard mapping. ImGui will use those indices to peek into the io.KeyDown[] array.
io.KeyMap[ImGuiKey_LeftArrow] = SDL_SCANCODE_LEFT;
io.KeyMap[ImGuiKey_RightArrow] = SDL_SCANCODE_RIGHT;
io.KeyMap[ImGuiKey_UpArrow] = SDL_SCANCODE_UP;
io.KeyMap[ImGuiKey_DownArrow] = SDL_SCANCODE_DOWN;
io.KeyMap[ImGuiKey_PageUp] = SDL_SCANCODE_PAGEUP;
io.KeyMap[ImGuiKey_PageDown] = SDL_SCANCODE_PAGEDOWN;
io.KeyMap[ImGuiKey_Home] = SDL_SCANCODE_HOME;
io.KeyMap[ImGuiKey_End] = SDL_SCANCODE_END;
io.KeyMap[ImGuiKey_Delete] = SDLK_DELETE;
io.KeyMap[ImGuiKey_Backspace] = SDLK_BACKSPACE;
io.KeyMap[ImGuiKey_Enter] = SDLK_RETURN;
io.KeyMap[ImGuiKey_Escape] = SDLK_ESCAPE;
io.KeyMap[ImGuiKey_A] = SDLK_a;
io.KeyMap[ImGuiKey_C] = SDLK_c;
io.KeyMap[ImGuiKey_V] = SDLK_v;
io.KeyMap[ImGuiKey_X] = SDLK_x;
io.KeyMap[ImGuiKey_Y] = SDLK_y;
io.KeyMap[ImGuiKey_Z] = SDLK_z;
io.RenderDrawListsFn = ImGui_ImplSdlGL3_RenderDrawLists; // Alternatively you can set this to NULL and call ImGui::GetDrawData() after ImGui::Render() to get the same ImDrawData pointer.
io.SetClipboardTextFn = ImGui_ImplSdlGL3_SetClipboardText;
io.GetClipboardTextFn = ImGui_ImplSdlGL3_GetClipboardText;
io.ClipboardUserData = NULL;
#ifdef _WIN32
SDL_SysWMinfo wmInfo;
SDL_VERSION(&wmInfo.version);
SDL_GetWindowWMInfo(window, &wmInfo);
io.ImeWindowHandle = wmInfo.info.win.window;
#else
(void)window;
#endif
return true;
}
void ImGui_ImplSdlGL3_Shutdown()
{
ImGui_ImplSdlGL3_InvalidateDeviceObjects();
ImGui::Shutdown();
}
void ImGui_ImplSdlGL3_NewFrame(SDL_Window* window)
{
if (!g_FontTexture)
ImGui_ImplSdlGL3_CreateDeviceObjects();
ImGuiIO& io = ImGui::GetIO();
// Setup display size (every frame to accommodate for window resizing)
int w, h;
int display_w, display_h;
SDL_GetWindowSize(window, &w, &h);
SDL_GL_GetDrawableSize(window, &display_w, &display_h);
io.DisplaySize = ImVec2((float)w, (float)h);
io.DisplayFramebufferScale = ImVec2(w > 0 ? ((float)display_w / w) : 0, h > 0 ? ((float)display_h / h) : 0);
// Setup time step
Uint32 time = SDL_GetTicks();
double current_time = time / 1000.0;
io.DeltaTime = g_Time > 0.0 ? (float)(current_time - g_Time) : (float)(1.0f / 60.0f);
g_Time = current_time;
// Setup inputs
// (we already got mouse wheel, keyboard keys & characters from SDL_PollEvent())
int mx, my;
Uint32 mouseMask = SDL_GetMouseState(&mx, &my);
if (SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_FOCUS)
io.MousePos = ImVec2((float)mx, (float)my); // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
else
io.MousePos = ImVec2(-1, -1);
io.MouseDown[0] = g_MousePressed[0] || (mouseMask & SDL_BUTTON(SDL_BUTTON_LEFT)) != 0; // If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
io.MouseDown[1] = g_MousePressed[1] || (mouseMask & SDL_BUTTON(SDL_BUTTON_RIGHT)) != 0;
io.MouseDown[2] = g_MousePressed[2] || (mouseMask & SDL_BUTTON(SDL_BUTTON_MIDDLE)) != 0;
g_MousePressed[0] = g_MousePressed[1] = g_MousePressed[2] = false;
io.MouseWheel = g_MouseWheel;
g_MouseWheel = 0.0f;
// Hide OS mouse cursor if ImGui is drawing it
SDL_ShowCursor(io.MouseDrawCursor ? 0 : 1);
// Start the frame
ImGui::NewFrame();
}
| [
"kretash@gmail.com"
] | kretash@gmail.com |
bcaf15d333e36ee74ab90206f5f051ca8818e0eb | 98b1e51f55fe389379b0db00365402359309186a | /homework_3/case_1/25/phi | 5ec4870bb7681cae4a0b660a7527654ce186ab80 | [] | no_license | taddyb/597-009 | f14c0e75a03ae2fd741905c4c0bc92440d10adda | 5f67e7d3910e3ec115fb3f3dc89a21dcc9a1b927 | refs/heads/main | 2023-01-23T08:14:47.028429 | 2020-12-03T13:24:27 | 2020-12-03T13:24:27 | 311,713,551 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,672 | /*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
location "25";
object phi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 3 -1 0 0 0 0];
internalField nonuniform List<scalar>
208
(
6.75294e-06
-6.75294e-06
1.71972e-05
-1.04442e-05
1.61366e-05
1.0606e-06
1.39753e-06
1.47391e-05
-6.68452e-05
6.82427e-05
7.35206e-05
-0.000140366
-2.5739e-06
-4.17904e-06
-1.27944e-05
-2.23721e-07
-4.15238e-05
2.97899e-05
-8.76272e-05
6.08424e-05
-0.000122567
0.000103183
8.2017e-05
-0.000131064
-7.42034e-06
3.2413e-06
-2.48385e-05
1.71944e-05
-4.90169e-05
5.39684e-05
-7.65171e-05
8.83427e-05
-9.5215e-05
0.000121881
8.03957e-05
-9.35937e-05
-9.86638e-06
1.31077e-05
-2.29571e-05
3.02851e-05
-3.79135e-05
6.89248e-05
-4.97902e-05
0.000100219
-5.61634e-05
0.000128254
7.20972e-05
-4.78648e-05
-5.07269e-06
1.81804e-05
-1.30014e-05
3.82138e-05
-1.45172e-05
7.04406e-05
-1.11757e-05
9.6878e-05
-4.84132e-06
0.00012192
6.65896e-05
6.66199e-07
-3.94682e-06
2.21272e-05
-3.31966e-06
3.75867e-05
6.36122e-06
6.07597e-05
2.13094e-05
8.19298e-05
3.10409e-05
0.000112188
6.90268e-05
2.86037e-05
1.72943e-06
2.03978e-05
-4.2046e-06
4.35207e-05
4.44287e-06
5.21122e-05
2.41122e-05
6.22605e-05
4.77625e-05
8.85377e-05
6.20149e-05
5.47744e-05
4.26695e-06
1.61308e-05
1.08246e-05
3.6963e-05
2.03434e-05
4.25935e-05
3.26536e-05
4.99503e-05
5.55857e-05
6.56057e-05
5.60389e-05
6.15617e-05
-4.95552e-05
6.5686e-05
-4.77673e-05
3.51752e-05
-3.87962e-05
3.36223e-05
-1.88852e-05
3.00393e-05
1.52927e-05
3.14278e-05
2.91657e-05
4.21659e-05
6.5686e-05
0.000100861
0.000134483
0.000164523
0.000195951
0.000225116
-0.000116413
8.15243e-05
-0.000105477
-7.22154e-05
-5.00376e-05
5.8397e-06
-2.34606e-05
-3.10722e-05
-1.76827e-05
-0.00014078
0.00011732
-0.000106852
5.73128e-05
-9.18206e-05
-6.50694e-05
-4.17052e-05
-8.11875e-05
-0.000182485
-6.44149e-05
2.81339e-05
-5.71459e-05
-7.23384e-05
-3.35215e-05
-0.000104812
-0.000216007
-2.64173e-05
6.6864e-06
-2.77162e-05
-7.10395e-05
-1.9847e-05
-0.000112681
-0.000235854
7.18113e-06
1.71469e-07
-6.04099e-06
-5.78173e-05
-1.09505e-05
-0.000107771
-0.000246805
2.87023e-05
7.28667e-08
1.17395e-05
-4.08546e-05
-4.08168e-07
-9.56238e-05
-0.000247213
4.86422e-05
6.2051e-06
1.86559e-05
-1.08683e-05
-6.16618e-07
-7.63512e-05
-0.000247829
5.15429e-05
1.62239e-05
2.69213e-05
1.37533e-05
1.93724e-05
-6.88024e-05
-0.000228457
4.80243e-05
1.03654e-05
5.97532e-05
2.02448e-06
5.99071e-05
-6.89563e-05
-0.00016855
0.000235482
0.000237506
0.00016855
-2.2825e-05
2.2825e-05
-3.76391e-05
1.48142e-05
-4.20606e-05
4.42147e-06
-4.20606e-05
-2.45372e-05
4.73622e-05
-3.43586e-05
2.46355e-05
-4.29065e-05
1.29694e-05
-8.49671e-05
-2.37343e-05
7.10965e-05
-1.4239e-05
1.51402e-05
-2.75049e-05
2.62353e-05
-0.000112472
-3.43803e-05
-1.34004e-05
-4.84774e-06
)
;
boundaryField
{
movingWall
{
type calculated;
value uniform 0;
}
fixedWalls
{
type calculated;
value uniform 0;
}
frontAndBack
{
type empty;
value nonuniform List<scalar> 0();
}
}
// ************************************************************************* //
| [
"tbindas@pop-os.localdomain"
] | tbindas@pop-os.localdomain | |
274c10d3f12476b228ea923c1ce85a2ab0c69ed0 | b086f85f98fc399b210245f5c0f8f0ffeb22dbfa | /NFServer/NFGameLogicPlugin/NFCItemConsumeManagerModule.cpp | 05e5a2178bf9ad38bff425d2eadc6f07118950a6 | [
"Apache-2.0"
] | permissive | meoneko/NoahGameFrame | 93b2e775e29c7c4476de898c4f2007f6530461df | 645255c2859cc4b828bae28e16db9f8980729b82 | refs/heads/develop | 2021-01-17T23:37:29.844348 | 2015-11-14T16:08:51 | 2015-11-14T16:08:51 | 46,468,588 | 1 | 0 | null | 2015-11-19T04:56:53 | 2015-11-19T04:56:53 | null | GB18030 | C++ | false | false | 1,177 | cpp | // -------------------------------------------------------------------------
// @FileName : NFCItemConsumeManagerModule.cpp
// @Author : LvSheng.Huang
// @Date : 2013-09-28
// @Module : NFCItemConsumeManagerModule
// @Desc : 道具消费机制管理类,所有类型的道具消费类型均需注册才能消费
// -------------------------------------------------------------------------
#include "NFCItemConsumeManagerModule.h"
//
bool NFCItemConsumeManagerModule::Init()
{
return true;
}
bool NFCItemConsumeManagerModule::Shut()
{
return true;
}
bool NFCItemConsumeManagerModule::Execute( const float fLasFrametime, const float fStartedTime )
{
return true;
}
bool NFCItemConsumeManagerModule::AfterInit()
{
return true;
}
bool NFCItemConsumeManagerModule::ResgisterConsumeModule( const int nModuleType, NFIItemConsumeProcessModule* pModule )
{
return AddElement( nModuleType, pModule );
}
NFIItemConsumeProcessModule* NFCItemConsumeManagerModule::GetConsumeModule( const int nModuleType )
{
return GetElement( nModuleType );
}
| [
"340006@qq.com"
] | 340006@qq.com |
65aef935111083e02409f12ef30d6129b89b5018 | a585a35f5a6c6468324ec60e0b14aa55d06a12ae | /src/collision_handler.cpp | c33f2d08d9ab07c81d270977cab85a07bd1b11dc | [] | no_license | vrndr/gamedev | dacc00617e4f5329dfa69ea29276ddea80b5604c | 7c30677b9738fd049fee227039ec5b4060d78d1d | refs/heads/master | 2021-01-23T19:38:25.884842 | 2014-03-08T06:55:31 | 2014-03-08T06:55:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,142 | cpp |
#include <algorithm>
#include "actor.h"
#include "collision_handler.h"
#include "stage.h"
void CollisionHandler::init() {
}
bool isActiveMovingActor(Actor *actor) {
return actor->isActorActive() && actor->isActorMoving();
}
Rectangle *getOverlaps(Actor *mainActor, Actor *otherActor) {
if (mainActor == otherActor) {
return NULL;
}
if (!otherActor->isActorCollidable()) {
return NULL;
}
Rectangle mainActorRect = mainActor->getPosition();
Rectangle otherActorRect = otherActor->getPosition();
float mx1 = mainActorRect.getX();
float my1 = mainActorRect.getY();
float mx2 = mainActorRect.getX() + mainActorRect.getWidth();
float my2 = mainActorRect.getY() + mainActorRect.getHeight();
float ox1 = otherActorRect.getX();
float oy1 = otherActorRect.getY();
float ox2 = otherActorRect.getX() + otherActorRect.getWidth();
float oy2 = otherActorRect.getY() + otherActorRect.getHeight();
float xLeft = std::max(mx1, ox1);
float xRight = std::min(mx2, ox2);
if (xLeft > xRight) {
return NULL;
}
float yTop = std::max(my1, oy1);
float yBottom = std::min(my2, oy2);
if (yTop > yBottom) {
return NULL;
}
Rectangle *overlap = new Rectangle(xLeft, yTop, xRight - xLeft, yBottom - yTop);
return overlap;
}
void notifyActors(Actor *mainActor, Actor *otherActor, Rectangle *overlap) {
mainActor->onCollision(otherActor, overlap);
otherActor->onCollision(mainActor, overlap);
}
void handleCollisionsWithOtherActors(Actor *mainActor, std::list<Actor *> allActors) {
for (std::list<Actor *>::iterator actor = allActors.begin();
actor != allActors.end(); actor++) {
Rectangle *overlap = getOverlaps(mainActor, *actor);
if (overlap) {
notifyActors(mainActor, *actor, overlap);
delete overlap;
}
}
}
void CollisionHandler::checkCollisions(const Stage &stage) {
std::list<Actor *> actors = stage.getAllActors();
for (std::list<Actor *>::iterator actor = actors.begin();
actor != actors.end(); actor++) {
if (!isActiveMovingActor(*actor)) {
continue;
}
handleCollisionsWithOtherActors(*actor, actors);
}
}
| [
"suphya4u@gmail.com"
] | suphya4u@gmail.com |
d2d22d1de0ce596995d803123d00f3a35e406984 | e7f92baffbf63d51adbec467fa8857d0ea34c413 | /src/tree/hist/evaluate_splits.h | 24b99ed4a8c73ea1a833810eecd5e1257801d9cf | [
"Apache-2.0"
] | permissive | Neilo99/xgboost | 66d2b27f62c3ab9197cb02c7a5103847719b70cc | 239dbb3c0a793c31ff16bb2f994f163f4698432a | refs/heads/master | 2021-11-23T08:03:12.097068 | 2021-10-30T06:40:32 | 2021-10-30T06:40:32 | 216,070,388 | 0 | 0 | Apache-2.0 | 2019-10-18T16:59:37 | 2019-10-18T16:59:37 | null | UTF-8 | C++ | false | false | 10,723 | h | /*!
* Copyright 2021 by XGBoost Contributors
*/
#ifndef XGBOOST_TREE_HIST_EVALUATE_SPLITS_H_
#define XGBOOST_TREE_HIST_EVALUATE_SPLITS_H_
#include <algorithm>
#include <memory>
#include <limits>
#include <utility>
#include <vector>
#include "../param.h"
#include "../constraints.h"
#include "../split_evaluator.h"
#include "../../common/random.h"
#include "../../common/hist_util.h"
#include "../../data/gradient_index.h"
namespace xgboost {
namespace tree {
template <typename GradientSumT, typename ExpandEntry> class HistEvaluator {
private:
struct NodeEntry {
/*! \brief statics for node entry */
GradStats stats;
/*! \brief loss of this node, without split */
bst_float root_gain{0.0f};
};
private:
TrainParam param_;
std::shared_ptr<common::ColumnSampler> column_sampler_;
TreeEvaluator tree_evaluator_;
int32_t n_threads_ {0};
FeatureInteractionConstraintHost interaction_constraints_;
std::vector<NodeEntry> snode_;
// if sum of statistics for non-missing values in the node
// is equal to sum of statistics for all values:
// then - there are no missing values
// else - there are missing values
bool static SplitContainsMissingValues(const GradStats e,
const NodeEntry &snode) {
if (e.GetGrad() == snode.stats.GetGrad() &&
e.GetHess() == snode.stats.GetHess()) {
return false;
} else {
return true;
}
}
// Enumerate/Scan the split values of specific feature
// Returns the sum of gradients corresponding to the data points that contains
// a non-missing value for the particular feature fid.
template <int d_step>
GradStats EnumerateSplit(
common::HistogramCuts const &cut, const common::GHistRow<GradientSumT> &hist,
const NodeEntry &snode, SplitEntry *p_best, bst_feature_t fidx,
bst_node_t nidx,
TreeEvaluator::SplitEvaluator<TrainParam> const &evaluator) const {
static_assert(d_step == +1 || d_step == -1, "Invalid step.");
// aliases
const std::vector<uint32_t> &cut_ptr = cut.Ptrs();
const std::vector<bst_float> &cut_val = cut.Values();
// statistics on both sides of split
GradStats c;
GradStats e;
// best split so far
SplitEntry best;
// bin boundaries
CHECK_LE(cut_ptr[fidx],
static_cast<uint32_t>(std::numeric_limits<int32_t>::max()));
CHECK_LE(cut_ptr[fidx + 1],
static_cast<uint32_t>(std::numeric_limits<int32_t>::max()));
// imin: index (offset) of the minimum value for feature fid
// need this for backward enumeration
const auto imin = static_cast<int32_t>(cut_ptr[fidx]);
// ibegin, iend: smallest/largest cut points for feature fid
// use int to allow for value -1
int32_t ibegin, iend;
if (d_step > 0) {
ibegin = static_cast<int32_t>(cut_ptr[fidx]);
iend = static_cast<int32_t>(cut_ptr.at(fidx + 1));
} else {
ibegin = static_cast<int32_t>(cut_ptr[fidx + 1]) - 1;
iend = static_cast<int32_t>(cut_ptr[fidx]) - 1;
}
for (int32_t i = ibegin; i != iend; i += d_step) {
// start working
// try to find a split
e.Add(hist[i].GetGrad(), hist[i].GetHess());
if (e.GetHess() >= param_.min_child_weight) {
c.SetSubstract(snode.stats, e);
if (c.GetHess() >= param_.min_child_weight) {
bst_float loss_chg;
bst_float split_pt;
if (d_step > 0) {
// forward enumeration: split at right bound of each bin
loss_chg = static_cast<bst_float>(
evaluator.CalcSplitGain(param_, nidx, fidx, GradStats{e},
GradStats{c}) -
snode.root_gain);
split_pt = cut_val[i];
best.Update(loss_chg, fidx, split_pt, d_step == -1, e, c);
} else {
// backward enumeration: split at left bound of each bin
loss_chg = static_cast<bst_float>(
evaluator.CalcSplitGain(param_, nidx, fidx, GradStats{c},
GradStats{e}) -
snode.root_gain);
if (i == imin) {
// for leftmost bin, left bound is the smallest feature value
split_pt = cut.MinValues()[fidx];
} else {
split_pt = cut_val[i - 1];
}
best.Update(loss_chg, fidx, split_pt, d_step == -1, c, e);
}
}
}
}
p_best->Update(best);
return e;
}
public:
void EvaluateSplits(const common::HistCollection<GradientSumT> &hist,
common::HistogramCuts const &cut, const RegTree &tree,
std::vector<ExpandEntry>* p_entries) {
auto& entries = *p_entries;
// All nodes are on the same level, so we can store the shared ptr.
std::vector<std::shared_ptr<HostDeviceVector<bst_feature_t>>> features(
entries.size());
for (size_t nidx_in_set = 0; nidx_in_set < entries.size(); ++nidx_in_set) {
auto nidx = entries[nidx_in_set].nid;
features[nidx_in_set] =
column_sampler_->GetFeatureSet(tree.GetDepth(nidx));
}
CHECK(!features.empty());
const size_t grain_size =
std::max<size_t>(1, features.front()->Size() / n_threads_);
common::BlockedSpace2d space(entries.size(), [&](size_t nidx_in_set) {
return features[nidx_in_set]->Size();
}, grain_size);
std::vector<ExpandEntry> tloc_candidates(omp_get_max_threads() * entries.size());
for (size_t i = 0; i < entries.size(); ++i) {
for (decltype(n_threads_) j = 0; j < n_threads_; ++j) {
tloc_candidates[i * n_threads_ + j] = entries[i];
}
}
auto evaluator = tree_evaluator_.GetEvaluator();
common::ParallelFor2d(space, n_threads_, [&](size_t nidx_in_set, common::Range1d r) {
auto tidx = omp_get_thread_num();
auto entry = &tloc_candidates[n_threads_ * nidx_in_set + tidx];
auto best = &entry->split;
auto nidx = entry->nid;
auto histogram = hist[nidx];
auto features_set = features[nidx_in_set]->ConstHostSpan();
for (auto fidx_in_set = r.begin(); fidx_in_set < r.end(); fidx_in_set++) {
auto fidx = features_set[fidx_in_set];
if (interaction_constraints_.Query(nidx, fidx)) {
auto grad_stats = EnumerateSplit<+1>(cut, histogram, snode_[nidx],
best, fidx, nidx, evaluator);
if (SplitContainsMissingValues(grad_stats, snode_[nidx])) {
EnumerateSplit<-1>(cut, histogram, snode_[nidx], best, fidx, nidx,
evaluator);
}
}
}
});
for (unsigned nidx_in_set = 0; nidx_in_set < entries.size();
++nidx_in_set) {
for (auto tidx = 0; tidx < n_threads_; ++tidx) {
entries[nidx_in_set].split.Update(
tloc_candidates[n_threads_ * nidx_in_set + tidx].split);
}
}
}
// Add splits to tree, handles all statistic
void ApplyTreeSplit(ExpandEntry candidate, RegTree *p_tree) {
auto evaluator = tree_evaluator_.GetEvaluator();
RegTree &tree = *p_tree;
GradStats parent_sum = candidate.split.left_sum;
parent_sum.Add(candidate.split.right_sum);
auto base_weight =
evaluator.CalcWeight(candidate.nid, param_, GradStats{parent_sum});
auto left_weight = evaluator.CalcWeight(
candidate.nid, param_, GradStats{candidate.split.left_sum});
auto right_weight = evaluator.CalcWeight(
candidate.nid, param_, GradStats{candidate.split.right_sum});
tree.ExpandNode(candidate.nid, candidate.split.SplitIndex(),
candidate.split.split_value, candidate.split.DefaultLeft(),
base_weight, left_weight * param_.learning_rate,
right_weight * param_.learning_rate,
candidate.split.loss_chg, parent_sum.GetHess(),
candidate.split.left_sum.GetHess(),
candidate.split.right_sum.GetHess());
// Set up child constraints
auto left_child = tree[candidate.nid].LeftChild();
auto right_child = tree[candidate.nid].RightChild();
tree_evaluator_.AddSplit(candidate.nid, left_child, right_child,
tree[candidate.nid].SplitIndex(), left_weight,
right_weight);
auto max_node = std::max(left_child, tree[candidate.nid].RightChild());
max_node = std::max(candidate.nid, max_node);
snode_.resize(tree.GetNodes().size());
snode_.at(left_child).stats = candidate.split.left_sum;
snode_.at(left_child).root_gain = evaluator.CalcGain(
candidate.nid, param_, GradStats{candidate.split.left_sum});
snode_.at(right_child).stats = candidate.split.right_sum;
snode_.at(right_child).root_gain = evaluator.CalcGain(
candidate.nid, param_, GradStats{candidate.split.right_sum});
interaction_constraints_.Split(candidate.nid,
tree[candidate.nid].SplitIndex(), left_child,
right_child);
}
auto Evaluator() const { return tree_evaluator_.GetEvaluator(); }
auto const& Stats() const { return snode_; }
float InitRoot(GradStats const& root_sum) {
snode_.resize(1);
auto root_evaluator = tree_evaluator_.GetEvaluator();
snode_[0].stats = GradStats{root_sum.GetGrad(), root_sum.GetHess()};
snode_[0].root_gain = root_evaluator.CalcGain(RegTree::kRoot, param_,
GradStats{snode_[0].stats});
auto weight = root_evaluator.CalcWeight(RegTree::kRoot, param_,
GradStats{snode_[0].stats});
return weight;
}
public:
// The column sampler must be constructed by caller since we need to preserve the rng
// for the entire training session.
explicit HistEvaluator(TrainParam const ¶m, MetaInfo const &info,
int32_t n_threads,
std::shared_ptr<common::ColumnSampler> sampler,
bool skip_0_index = false)
: param_{param}, column_sampler_{std::move(sampler)},
tree_evaluator_{param, static_cast<bst_feature_t>(info.num_col_),
GenericParameter::kCpuId},
n_threads_{n_threads} {
interaction_constraints_.Configure(param, info.num_col_);
column_sampler_->Init(info.num_col_, info.feature_weigths.HostVector(),
param_.colsample_bynode, param_.colsample_bylevel,
param_.colsample_bytree, skip_0_index);
}
};
} // namespace tree
} // namespace xgboost
#endif // XGBOOST_TREE_HIST_EVALUATE_SPLITS_H_
| [
"noreply@github.com"
] | noreply@github.com |
be39e998229c07a71a3f5ee65ab162eed0125dff | c75f5eb710feede3a3677bafbe06f76711487db3 | /Engine/Engine/Accessory.cpp | 50b2c5db2fc9ce410d2e41424978402937fbe3c0 | [
"MIT"
] | permissive | s-chang/Final | c4e3e64fd36f4ff01e3c525ebd3456899b315daa | 4f02e3970afa830096a187e5148114c03761fbd4 | refs/heads/master | 2021-01-16T19:20:12.641886 | 2014-10-21T02:10:24 | 2014-10-21T02:10:24 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 164 | cpp | #include "Accessory.h"
Accessory::Accessory()
{}
Accessory::Accessory(ItemStats stats)
{
setStats(stats);
}
Accessory::~Accessory()
{}
void Accessory::use()
{} | [
"smythchang@gmail.com"
] | smythchang@gmail.com |
4115fc9a559ed2142e01e077e653b08e0a8a3078 | 6e0b25bf4106b09a103ad7bfeb2fe174e46c9176 | /pr9/re10/3.9/uniform/time | a64a2748406c37895bdbccc5dc49cf81acd44678 | [] | no_license | franterminator/OpenFoamCaminos | 3bc1d207bed77408f31ef1846a35794fab8cd3d5 | 5556bc3ddf9cf8aa5a661cd3af74a2b2d76d3471 | refs/heads/master | 2020-04-16T04:28:19.657010 | 2019-01-11T15:58:00 | 2019-01-11T15:58:00 | 165,268,264 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 992 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 5.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "3.9/uniform";
object time;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
value 3.89999999999993907;
name "3.9";
index 780;
deltaT 0.005;
deltaT0 0.005;
// ************************************************************************* //
| [
"franterminator@hotmail.com"
] | franterminator@hotmail.com | |
2c038b2de5246fae626f757f72954c5cabb02e74 | c2c9e9bd2644d89e573e50e00993a2c07076d2e2 | /Examples/CXX/Miscellanous/TrajFromDB/SQLTable.cpp | 07dee242d1b2a489c9a97a67c36af015820197d6 | [
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"BSL-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | TotteKarlsson/dsl | eeab84f4b6d0c951d73ff275b734b503ddb081c0 | 3807cbe5f90a3cd495979eafa8cf5485367b634c | refs/heads/master | 2021-06-17T11:38:02.395605 | 2019-12-11T17:51:41 | 2019-12-11T17:51:41 | 166,859,372 | 0 | 0 | NOASSERTION | 2019-06-11T18:45:24 | 2019-01-21T18:17:04 | Pascal | UTF-8 | C++ | false | false | 176 | cpp | #ifdef WINDOWS
#ifdef USEPCH
#include "pch.h"
#endif
#pragma hdrstop
#endif
//==============================
#include <iostream>
#include "SQLTable.h"
using namespace std;
| [
"tottek@gmail.com"
] | tottek@gmail.com |
3c37bbbee744deaa8d7980e68262a28a8c34f497 | 8b85c346f07bb38ca7731d0625b79a97d7ed7166 | /InfoLogger/src/InfoLoggerClient.h | a50e19873902be2929117e10f25ae3719a940246 | [] | no_license | dberzano/FlpPrototype | a9f12bfd66319b59e927c2a24ffd8714135e2ea2 | 8728578dac4b099ea7a049816f9925c359734a69 | refs/heads/master | 2021-01-01T11:58:12.501754 | 2017-07-18T06:58:39 | 2017-07-18T06:58:39 | 97,578,160 | 0 | 0 | null | 2017-07-18T09:10:51 | 2017-07-18T09:10:51 | null | UTF-8 | C++ | false | false | 1,004 | h | #include <Common/SimpleLog.h>
// class to communicate with local infoLoggerD process
class ConfigInfoLoggerClient {
public:
ConfigInfoLoggerClient(const char*configPath=nullptr);
~ConfigInfoLoggerClient();
void resetConfig(); // set default configuration parameters
std::string *txSocketPath; // name of socket used to receive log messages from clients
int txSocketOutBufferSize;
};
class InfoLoggerClient {
public:
InfoLoggerClient();
~InfoLoggerClient();
// status on infoLoggerD connection
// returns 1 if client ok, 0 if not
int isOk();
// sends (already encoded) message to infoLoggerD
// returns 0 on success, an error code otherwise
int send(const char *message, unsigned int messageSize);
private:
ConfigInfoLoggerClient cfg;
int isInitialized; // set to 1 when object initialized with success, 0 otherwise
SimpleLog log; // object for daemon logging, as defined in config
int txSocket; // socket to infoLoggerD. >=0 if set.
};
| [
"o2.syc@cern.ch"
] | o2.syc@cern.ch |
5f4dc22aeeea4105c5448bda1c16000fc9d7addd | 21df29f0aca4ea68bf922fadaae52772bea993ad | /src/qt/recentrequeststablemodel.h | 30b20b8847e3c93e43b36ac0361632f92594ef40 | [
"MIT"
] | permissive | RegulusBit/utabit13 | 48767b2bdfb9e0872d66d1f530c64c09aaba679b | eb8b301e77fe116a43df87fabe1cb45da358213a | refs/heads/master | 2019-07-13T05:22:36.037577 | 2017-07-26T16:44:41 | 2017-07-26T16:44:41 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,309 | h | // Copyright (c) 2011-2015 The Utabit Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef UTABIT_QT_RECENTREQUESTSTABLEMODEL_H
#define UTABIT_QT_RECENTREQUESTSTABLEMODEL_H
#include "walletmodel.h"
#include <QAbstractTableModel>
#include <QStringList>
#include <QDateTime>
class CWallet;
class RecentRequestEntry
{
public:
RecentRequestEntry() : nVersion(RecentRequestEntry::CURRENT_VERSION), id(0) { }
static const int CURRENT_VERSION = 1;
int nVersion;
int64_t id;
QDateTime date;
SendCoinsRecipient recipient;
ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
unsigned int nDate = date.toTime_t();
READWRITE(this->nVersion);
nVersion = this->nVersion;
READWRITE(id);
READWRITE(nDate);
READWRITE(recipient);
if (ser_action.ForRead())
date = QDateTime::fromTime_t(nDate);
}
};
class RecentRequestEntryLessThan
{
public:
RecentRequestEntryLessThan(int nColumn, Qt::SortOrder fOrder):
column(nColumn), order(fOrder) {}
bool operator()(RecentRequestEntry &left, RecentRequestEntry &right) const;
private:
int column;
Qt::SortOrder order;
};
/** Model for list of recently generated payment requests / utabit: URIs.
* Part of wallet model.
*/
class RecentRequestsTableModel: public QAbstractTableModel
{
Q_OBJECT
public:
explicit RecentRequestsTableModel(CWallet *wallet, WalletModel *parent);
~RecentRequestsTableModel();
enum ColumnIndex {
Date = 0,
Label = 1,
Message = 2,
Amount = 3,
NUMBER_OF_COLUMNS
};
/** @name Methods overridden from QAbstractTableModel
@{*/
int rowCount(const QModelIndex &parent) const;
int columnCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
bool setData(const QModelIndex &index, const QVariant &value, int role);
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
QModelIndex index(int row, int column, const QModelIndex &parent) const;
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
Qt::ItemFlags flags(const QModelIndex &index) const;
/*@}*/
const RecentRequestEntry &entry(int row) const { return list[row]; }
void addNewRequest(const SendCoinsRecipient &recipient);
void addNewRequest(const std::string &recipient);
void addNewRequest(RecentRequestEntry &recipient);
public Q_SLOTS:
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
void updateDisplayUnit();
private:
WalletModel *walletModel;
QStringList columns;
QList<RecentRequestEntry> list;
int64_t nReceiveRequestsMaxId;
/** Updates the column title to "Amount (DisplayUnit)" and emits headerDataChanged() signal for table headers to react. */
void updateAmountColumnTitle();
/** Gets title for amount column including current display unit if optionsModel reference available. */
QString getAmountTitle();
};
#endif // UTABIT_QT_RECENTREQUESTSTABLEMODEL_H
| [
"utabitinfo@gmail.com"
] | utabitinfo@gmail.com |
b6cd2275888300a3c017b091bac42b23117c3ccd | 5cd256ced3268556a55098a8c1399a741d410c5e | /source/modules/distrho/src/DistrhoUI.cpp | 25e4965b4f46376197a61b803cdecf69a3e9c4b0 | [] | no_license | AndreeeCZ/Carla | fdac25f7b89a2e43db8ba3a52d1e08e48fe3b3e5 | 8c4ebc7841270a8a4af894ba3761da308b64241e | refs/heads/master | 2021-01-18T01:41:41.425748 | 2014-02-06T12:53:23 | 2014-02-06T12:53:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,411 | cpp | /*
* DISTRHO Plugin Toolkit (DPT)
* Copyright (C) 2012-2013 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
* permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
* TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "DistrhoUIInternal.hpp"
START_NAMESPACE_DGL
extern Window* dgl_lastUiParent;
END_NAMESPACE_DGL
START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------
// Static data
double d_lastUiSampleRate = 0.0;
// -----------------------------------------------------------------------
// UI
UI::UI()
: DGL::Widget(*DGL::dgl_lastUiParent),
pData(new PrivateData())
{
assert(DGL::dgl_lastUiParent != nullptr);
DGL::dgl_lastUiParent = nullptr;
}
UI::~UI()
{
delete pData;
}
// -----------------------------------------------------------------------
// Host DSP State
double UI::d_getSampleRate() const noexcept
{
return pData->sampleRate;
}
void UI::d_editParameter(uint32_t index, bool started)
{
pData->editParamCallback(index + pData->parameterOffset, started);
}
void UI::d_setParameterValue(uint32_t index, float value)
{
pData->setParamCallback(index + pData->parameterOffset, value);
}
#if DISTRHO_PLUGIN_WANT_STATE
void UI::d_setState(const char* key, const char* value)
{
pData->setStateCallback(key, value);
}
#endif
#if DISTRHO_PLUGIN_IS_SYNTH
void UI::d_sendNote(uint8_t channel, uint8_t note, uint8_t velocity)
{
pData->sendNoteCallback(channel, note, velocity);
}
#endif
// -----------------------------------------------------------------------
// Host UI State
void UI::d_uiResize(unsigned int width, unsigned int height)
{
pData->uiResizeCallback(width, height);
}
// -----------------------------------------------------------------------
END_NAMESPACE_DISTRHO
| [
"falktx@gmail.com"
] | falktx@gmail.com |
c88fb224167c97848b5ebdcdb1def74bd8ece0d1 | 237ded6ac2cda3bdf259dd366cc3093068046010 | /src/mirrormaterial.cpp | a6ff170e9f25bdd248bf2cfbdeab7cf09104011a | [] | no_license | gidoca/renderer | 833a5d3c196eaa2b5791767877daa87741c060cd | f62a7b76c1e110aa9b016683989821592080f46b | refs/heads/master | 2021-01-10T10:46:51.020409 | 2016-03-19T23:40:51 | 2016-03-19T23:40:51 | 54,466,631 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,574 | cpp | /**
* Copyright (C) 2012 Gian Calgeer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in the
* Software without restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the
* following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies
* or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "mirrormaterial.h"
#include "hitrecord.h"
#include "intersectable.h"
#include "light.h"
#include "sampler.h"
#include "vechelper.h"
#include <QVector3D>
QVector3D MirrorMaterial::outDirection(const HitRecord &hit, Sample, float &pdf, cv::Vec3f &brdf) const
{
pdf = 1;
brdf = cv::Vec3f();
return reflect(hit.getRay().getDirection(), hit.getSurfaceNormal().normalized());
}
bool MirrorMaterial::isSpecular() const
{
return true;
}
| [
"gidoca@gmail.com"
] | gidoca@gmail.com |
c9754641ca17f9af215d67efd9b3e9b48ae09c0c | 6627d27fc69922f179b14b612b366bbf0bc4eff9 | /old/robots/common/xerolib/Rotation.cpp | 3694ac9430721b0f6a03f48fa38958eccf34fd17 | [] | no_license | errorcodexero/newarch | 1a4773377197174ae58b6e4ef6d670bf197c643b | e69a864012e09548014ad208affeb8901835a654 | refs/heads/master | 2021-06-03T16:28:41.840622 | 2020-03-15T18:15:08 | 2020-03-15T18:15:08 | 139,747,384 | 9 | 6 | null | 2020-01-31T05:35:34 | 2018-07-04T16:54:36 | C++ | UTF-8 | C++ | false | false | 198 | cpp | #include "Rotation.h"
#include "Position.h"
namespace xero
{
namespace base
{
Rotation::Rotation(const Position &pos)
{
m_cos = pos.getX();
m_sin = pos.getY();
normalize();
}
}
}
| [
"butchg@comcast.net"
] | butchg@comcast.net |
aaf2b28cbcab605ded1011d32dd526847ace288d | 32ddd9b23c88f9c078656cf09529567ba53f3262 | /unpv1/udpcliserv/udpcli01.cpp | d18b58b00555b1a09628b829701dd80d8cb27f4c | [] | no_license | lw1a2/test | 06769e141c0877ce37c02ca307f2934062c36342 | 0f647aa74c65c85f120b9f0a12981801af9df9ea | refs/heads/master | 2020-12-18T15:15:50.496440 | 2018-04-15T19:22:52 | 2018-04-15T19:22:52 | 4,145,806 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,307 | cpp | #include <sys/types.h>
#include <sys/socket.h>
#include <cstring>
#include <netinet/in.h>
#include <errno.h>
#include <cstdio>
#include <arpa/inet.h>
#include <iostream>
using namespace std;
typedef struct sockaddr SA;
#define MAXLINE 4096
void dg_cli(FILE *fp, int sockfd, SA* pservaddr, socklen_t servlen)
{
int n = 0;
char sendline[MAXLINE], recvline[MAXLINE + 1];
bzero(sendline, sizeof(sendline));
bzero(recvline, sizeof(recvline));
while (fgets(sendline, MAXLINE, fp) != NULL)
{
n = sendto(sockfd, sendline, strlen(sendline), 0, pservaddr, servlen);
if (-1 == n)
{
perror("sendto");
return;
}
else
{
char addrbuf[INET_ADDRSTRLEN];
bzero(addrbuf, sizeof(addrbuf));
cout << "sendto "
<< inet_ntop(AF_INET, &((struct sockaddr_in*)pservaddr)->sin_addr, addrbuf, sizeof(addrbuf))
<< endl;
}
struct sockaddr_in recvaddr;
socklen_t recvlen = servlen;
n = recvfrom(sockfd, recvline, MAXLINE, 0, (SA*)&recvaddr, &recvlen);
if (-1 == n)
{
perror("recvfrom");
return;
}
else
{
char addrbuf[INET_ADDRSTRLEN];
bzero(addrbuf, sizeof(addrbuf));
cout << "recvfrom "
<< inet_ntop(AF_INET, &((struct sockaddr_in*)pservaddr)->sin_addr, addrbuf, sizeof(addrbuf))
<< endl;
}
recvline[n] = 0;
if (fputs(recvline, stdout) == EOF)
{
perror("fputs");
return;
}
}
}
int main(int argc, char *argv[])
{
if (argc != 2)
{
cout << "usage: " << argv[0] << " <IPaddress>" << endl;
return 0;
}
int sockfd = socket(AF_INET, SOCK_DGRAM, 0);
if (-1 == sockfd)
{
perror("socket");
return errno;
}
struct sockaddr_in servaddr;
bzero(&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(8888);
int ret = inet_pton(AF_INET, argv[1], &servaddr.sin_addr);
if (-1 == ret)
{
perror("inet_pton");
return errno;
}
dg_cli(stdin, sockfd, (SA*)&servaddr, sizeof(servaddr));
return 0;
}
| [
"lw1a2@yahoo.com"
] | lw1a2@yahoo.com |
4daa2e887b7b7bb63a3b1b3d9fd8f2c91799948a | 1d8db68ab76f854c6485e3f845eae3721699a390 | /src/pmd_camboard_nano_cloud_mesh_generator_fast_triangulation.cpp | ec7bc414422c37f86cedc64654fca90b2a48db3c | [
"MIT"
] | permissive | aleksandaratanasov/pmd_camboard_nano | cab628678e3bbcdbc2fe51d5a68895d0a8ca0b86 | 4f56655dc94782f9d7b18a0ef6291f604eec815c | refs/heads/master | 2021-01-10T14:27:15.903758 | 2017-02-01T12:12:51 | 2017-02-01T12:12:51 | 40,981,530 | 0 | 0 | null | 2015-08-18T15:57:43 | 2015-08-18T15:57:43 | null | UTF-8 | C++ | false | false | 7,424 | cpp | /******************************************************************************
* Copyright (c) 2015 Aleksandar Vladimirov Atanasov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
******************************************************************************/
// ROS
// ROS - Misc
#include <ros/ros.h>
// ROS - Publishing
//#include <ros/publisher.h>
#include <pcl_ros/publisher.h>
// PCL
// PCL - Misc
#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h>
#include <pcl/io/vtk_lib_io.h> // For writing mesh to STL file
//#include <pcl/io/ply_io.h> // For writing mesh to PLY file
#include <pcl/io/vtk_io.h> // For writing mesh to VTK file
#include <pcl/point_types.h>
#include <pcl_conversions/pcl_conversions.h>
// PCL - Mesh generation
// Use fast triangulation
#include <pcl/kdtree/kdtree_flann.h>
#include <pcl/surface/gp3.h>
// Misc
#include <sstream>
#include <string>
#define degToRad(x) (M_PI*x/180)
class CloudProcessingNodeMGFT
{
typedef pcl::PointXYZ Point;
protected:
ros::NodeHandle nh;
ros::Subscriber sub;
// pcl_ros::Publisher<sensor_msgs::PointCloud2> pub;
private:
sensor_msgs::PointCloud2 cloud;
// For writing to files
u_int64_t fileIdx;
std::ostringstream ss;
bool toggleWritingToFile;
double searchRadius;
double mu;
int maxNN;
double maxSurfaceAngle;
double minAngle;
double maxAngle;
bool normalConsistency;
public:
CloudProcessingNodeMGFT(std::string topicIn/*, std::string topicOut*/)
: fileIdx(0)
{
sub = nh.subscribe<sensor_msgs::PointCloud2>(topicIn, 5, &CloudProcessingNodeMGFT::subCallback, this);
// pub.advertise(nh, topicOut, 1);
}
~CloudProcessingNodeMGFT()
{
sub.shutdown();
// pub.shutdown();
}
void setWritingToFile(bool toggle) { toggleWritingToFile = toggle; }
void setSearchRadius(double _searchRadius) { searchRadius = _searchRadius; }
void setMu(double _mu) { mu = _mu; }
void setMaxNN(int _maxNN) { maxNN = _maxNN; }
void setMaxSurfaceAngle(double maxSurfaceAngle_radians) { maxSurfaceAngle = maxSurfaceAngle_radians; }
void setMinAngle(double minAngle_radians) { minAngle = minAngle_radians; }
void setMaxAngle(double maxAngle_radians) { maxAngle = maxAngle_radians; }
void setNormalConsistency(bool _normalConsistency) { normalConsistency = _normalConsistency; }
void subCallback(const sensor_msgs::PointCloud2ConstPtr& msg)
{
if(msg->data.empty())
{
ROS_WARN("Received an empty cloud message. Skipping further processing");
return;
}
// Convert ROS message to PCL-compatible data structure
ROS_INFO_STREAM("Received a cloud message with " << msg->height * msg->width << " points");
ROS_INFO("Converting ROS cloud message to PCL compatible data structure");
pcl::PointCloud<pcl::PointNormal> pclCloud;
pcl::fromROSMsg(*msg, pclCloud);
pcl::PointCloud<pcl::PointNormal>::Ptr p_with_normals(new pcl::PointCloud<pcl::PointNormal>(pclCloud));
// Fast triangulation
// Source: http://pointclouds.org/documentation/tutorials/greedy_projection.php
// Create search tree
pcl::search::KdTree<pcl::PointNormal>::Ptr tree2 (new pcl::search::KdTree<pcl::PointNormal>);
tree2->setInputCloud(p_with_normals);
// Initialize objects
pcl::GreedyProjectionTriangulation<pcl::PointNormal> gp3;
pcl::PolygonMesh::Ptr mesh(new pcl::PolygonMesh);
// Set the maximum distance between connected points (maximum edge length)
gp3.setSearchRadius(searchRadius);
// Set typical values for the parameters
gp3.setMu(mu);
gp3.setMaximumNearestNeighbors(maxNN);
gp3.setMaximumSurfaceAngle(maxSurfaceAngle); // 45 degrees
gp3.setMinimumAngle(minAngle); // 10 degrees
gp3.setMaximumAngle(maxAngle); // 120 degrees
gp3.setNormalConsistency(normalConsistency);
// Get result
gp3.setInputCloud(p_with_normals);
gp3.setSearchMethod(tree2);
gp3.reconstruct(*mesh);
ROS_INFO_STREAM("Number of polygons: " << mesh->polygons.size());
// Additional vertex information
//std::vector<int> parts = gp3.getPartIDs();
//std::vector<int> states = gp3.getPointStates();
if(toggleWritingToFile)
{
std::string path = "/home/redbaron/catkin_ws/src/pmd_camboard_nano/samples/temp/";
ss << path << "cloud_mesh_generator_fast_triangulation_" << fileIdx << ".stl";
pcl::io::savePolygonFileSTL(ss.str(), *mesh);
ROS_INFO_STREAM("Writing to file \"" << ss.str() << "\"");
fileIdx++;
ss.str("");
}
// sensor_msgs::PointCloud2 output;
// pcl::toROSMsg(*p, output);
// pub.publish(output);
}
};
int main(int argc, char* argv[])
{
ros::init (argc, argv, "cloud_mesh_generator_fast_triangulation");
ros::NodeHandle nh("~");
std::string topicIn = "points_ne";
// std::string topicOut = "points_mg";
bool toggleWriteToFile;
double searchRadius;
double mu;
int maxNN;
double maxSurfaceAngle;
double minAngle;
double maxAngle;
bool normalConsistency;
nh.param("write_to_file", toggleWriteToFile, false);
nh.param("searchRadius", searchRadius, 0.025);
nh.param("mu", mu, 2.5);
nh.param("maxNN", maxNN, 100);
nh.param("maxSurfaceAngle", maxSurfaceAngle, 45.0);
nh.param("minAngle", minAngle, 10.0);
nh.param("maxAngle", maxAngle, 120.0);
nh.param("normalConsistency", normalConsistency, false);
// Convert angles to radians
maxSurfaceAngle = degToRad(maxSurfaceAngle);
minAngle = degToRad(minAngle);
maxAngle = degToRad(maxAngle);
CloudProcessingNodeMGFT c(topicIn/*, topicOut*/);
ROS_INFO_STREAM("Writing to files: " << (toggleWriteToFile ? "enabled" : "disabled") << "\n"
<< "Search radius: " << searchRadius << "\n"
<< "\u03BC: " << mu << "\n"
<< "Maximum nearest neighbours: " << maxNN << "\n"
<< "Maximum surface angle: " << maxSurfaceAngle << "\n"
<< "Minimum angle: " << minAngle << "\n"
<< "Maximum angle: " << maxAngle << "\n"
<< "Normal consistency: " << (normalConsistency ? "enabled" : "disabled"));
c.setWritingToFile(toggleWriteToFile);
c.setSearchRadius(searchRadius);
c.setMu(mu);
c.setMaxNN(maxNN);
c.setMaxSurfaceAngle(maxSurfaceAngle);
c.setMinAngle(minAngle);
c.setMaxAngle(maxAngle);
c.setNormalConsistency(normalConsistency);
while(nh.ok())
ros::spin();
return 0;
}
| [
"redbaronqueen@gmail.com"
] | redbaronqueen@gmail.com |
7fa6e0a256b96f516f45e951de1326ef14af538a | 32e41ef5d879e73c05888e05fe28403480cb4e20 | /lab1/b/Sublist.cpp | 9d44f6271e8775de315140fa71c063bf41c6d5c2 | [] | no_license | chrispaterson/cs2c | 1e67da3ef2bbb80efac747e13ffbaf98ecc39f37 | 57ed412ab175070e26ab7237af0b4a7e08e7936d | refs/heads/master | 2020-03-09T20:12:10.868866 | 2018-04-13T02:35:15 | 2018-04-13T02:35:15 | 128,978,201 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,019 | cpp | #include <iostream>
#include <string>
#include "Sublist.h"
const std::string TAB = " ";
Sublist::Sublist( std::vector<int> *orig) : sum(0), originalObjects(orig)
{};
bool Sublist::addItem( int indexOfItemToAdd )
{
indices.push_back( indexOfItemToAdd );
sum += originalObjects->at( indexOfItemToAdd );
return true;
}
void Sublist::showSublist() const
{
std::cout << "Sublist -------------------------" << std::endl;
std::cout << TAB << "sum: " << getSum() << std::endl;
for(int i = 0; i < indices.size(); i++) {
char endCommaMaybe = (i < indices.size() - 1) ? ',' : ' ';
std::cout << TAB << "array[" << i << "] = " << originalObjects->at(indices.at(i)) << endCommaMaybe ;
}
}
int Sublist::getSum() const
{
return sum;
}
std::vector<int> * Sublist::getSublistVector() {
return &indices;
}
void Sublist::addInitialIndicies(std::vector<int> * initIndicies) {
for(auto index : *initIndicies) {
sum += originalObjects->at( index );
indices.push_back(index);
}
}
| [
"cpaterson@conversantmedia.com"
] | cpaterson@conversantmedia.com |
87b5891aa1e43c00eafc9c5c5c2174d65ea5a08a | 3c364f1e3d0af0b650b96b1ac80aedd74940d3fb | /branches/unlabeled-1.1.2/plugins/_core/container.cpp | 4d09d1a87af7fbf828376770bdd4f2d661acd794 | [] | no_license | dhyannataraj/sim-im | aa8e938766f6304d9f71be883f0ef4e10a7c8c65 | 6b0d058cd5ab06ba72a34f09d44b3f0598960572 | refs/heads/master | 2021-04-03T04:26:23.903185 | 2011-10-10T15:58:45 | 2011-10-10T15:58:45 | 124,702,761 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 25,499 | cpp | /***************************************************************************
container.cpp - description
-------------------
begin : Sun Mar 10 2002
copyright : (C) 2002 by Vladimir Shutoff
email : vovan@shutoff.ru
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "container.h"
#include "userwnd.h"
#include "core.h"
#include "toolbtn.h"
#include <qmainwindow.h>
#include <qframe.h>
#include <qsplitter.h>
#include <qlayout.h>
#include <qstatusbar.h>
#include <qtabbar.h>
#include <qprogressbar.h>
#include <qwidgetstack.h>
#include <qtimer.h>
#include <qtoolbar.h>
#include <qpopupmenu.h>
#include <qaccel.h>
#include <qpainter.h>
#include <list>
using namespace std;
#ifdef WIN32
#include <windows.h>
#endif
const unsigned ACCEL_MESSAGE = 0x1000;
class UserTabBar : public QTabBar
{
public:
UserTabBar(QWidget *parent);
void raiseTab(unsigned id);
UserWnd *wnd(unsigned id);
UserWnd *currentWnd();
list<UserWnd*> windows();
void removeTab(unsigned id);
void changeTab(unsigned id);
void setBold(unsigned id, bool bState);
void setCurrent(unsigned i);
unsigned current();
bool isBold(UserWnd *wnd);
protected:
virtual void layoutTabs();
virtual void mousePressEvent(QMouseEvent *e);
virtual void paintLabel(QPainter *p, const QRect &rc, QTab *t, bool bFocus) const;
};
class UserTab : public QTab
{
public:
UserTab(UserWnd *wnd, bool bBold);
UserWnd *wnd() { return m_wnd; }
bool setBold(bool bState);
bool isBold() { return m_bBold; }
protected:
UserWnd *m_wnd;
bool m_bBold;
friend class UserTabBar;
};
class Splitter : public QSplitter
{
public:
Splitter(QWidget *p) : QSplitter(p) {}
protected:
virtual QSizePolicy sizePolicy() const;
};
ContainerStatus::ContainerStatus(QWidget *parent)
: QStatusBar(parent)
{
QSize s;
{
QProgressBar p(this);
addWidget(&p);
s = minimumSizeHint();
}
setMinimumSize(QSize(0, s.height()));
}
void ContainerStatus::resizeEvent(QResizeEvent *e)
{
QStatusBar::resizeEvent(e);
emit sizeChanged(width());
}
QSizePolicy Splitter::sizePolicy() const
{
return QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
}
static DataDef containerData[] =
{
{ "Id", DATA_ULONG, 1, 0 },
{ "Windows", DATA_STRING, 1, 0 },
{ "ActiveWindow", DATA_ULONG, 1, 0 },
{ "Geometry", DATA_ULONG, 4, 0 },
{ "BarState", DATA_ULONG, 7, 0 },
{ "StatusSize", DATA_ULONG, 1, 0 },
{ "WndConfig", DATA_STRLIST, 1, 0 },
{ NULL, 0, 0, 0 }
};
Container::Container(unsigned id, const char *cfg)
{
m_bInit = false;
m_bInSize = false;
m_bStatusSize = false;
m_bBarChanged = false;
m_bReceived = false;
m_bNoSwitch = false;
SET_WNDPROC("container")
setWFlags(WDestructiveClose);
QFrame *frm = new QFrame(this);
setCentralWidget(frm);
connect(CorePlugin::m_plugin, SIGNAL(modeChanged()), this, SLOT(modeChanged()));
QVBoxLayout *lay = new QVBoxLayout(frm);
m_wnds = new QWidgetStack(frm);
m_wnds->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
lay->addWidget(m_wnds);
m_tabSplitter = new Splitter(frm);
m_tabSplitter->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
m_tabBar = new UserTabBar(m_tabSplitter);
m_tabBar->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding));
m_tabBar->hide();
m_status = new ContainerStatus(m_tabSplitter);
lay->addWidget(m_tabSplitter);
load_data(containerData, &data, cfg);
if (cfg == NULL){
setId(id);
memcpy(data.barState, CorePlugin::m_plugin->data.containerBar, sizeof(data.barState));
data.geometry[2] = CorePlugin::m_plugin->data.containerSize[0];
data.geometry[3] = CorePlugin::m_plugin->data.containerSize[1];
setStatusSize(CorePlugin::m_plugin->getContainerStatusSize());
showBar();
m_bInit = true;
}
m_bInSize = true;
restoreGeometry(this, data.geometry);
m_bInSize = false;
connect(m_tabBar, SIGNAL(selected(int)), this, SLOT(contactSelected(int)));
connect(this, SIGNAL(toolBarPositionChanged(QToolBar*)), this, SLOT(toolbarChanged(QToolBar*)));
connect(m_status, SIGNAL(sizeChanged(int)), this, SLOT(statusChanged(int)));
m_accel = new QAccel(this);
connect(m_accel, SIGNAL(activated(int)), this, SLOT(accelActivated(int)));
setupAccel();
}
Container::~Container()
{
list<UserWnd*> wnds = m_tabBar->windows();
for (list<UserWnd*>::iterator it = wnds.begin(); it != wnds.end(); ++it){
disconnect(*it, SIGNAL(closed(UserWnd*)), this, SLOT(removeUserWnd(UserWnd*)));
}
free_data(containerData, &data);
}
void Container::setupAccel()
{
m_accel->clear();
m_accel->insertItem(Key_1 + ALT, 1);
m_accel->insertItem(Key_2 + ALT, 2);
m_accel->insertItem(Key_3 + ALT, 3);
m_accel->insertItem(Key_4 + ALT, 4);
m_accel->insertItem(Key_5 + ALT, 5);
m_accel->insertItem(Key_6 + ALT, 6);
m_accel->insertItem(Key_7 + ALT, 7);
m_accel->insertItem(Key_8 + ALT, 8);
m_accel->insertItem(Key_9 + ALT, 9);
m_accel->insertItem(Key_0 + ALT, 10);
m_accel->insertItem(Key_Left + ALT, 11);
m_accel->insertItem(Key_Right + ALT, 12);
m_accel->insertItem(Key_Home + ALT, 13);
m_accel->insertItem(Key_End + ALT, 14);
Event eMenu(EventGetMenuDef, (void*)MenuMessage);
CommandsDef *cmdsMsg = (CommandsDef*)(eMenu.process());
CommandsList it(*cmdsMsg, true);
CommandDef *c;
while ((c = ++it) != NULL){
if (c->accel == NULL)
continue;
m_accel->insertItem(QAccel::stringToKey(c->accel), ACCEL_MESSAGE + c->id);
}
}
void Container::setNoSwitch()
{
m_bNoSwitch = true;
}
string Container::getState()
{
clearWndConfig();
string windows;
list<UserWnd*> userWnds = m_tabBar->windows();
for (list<UserWnd*>::iterator it = userWnds.begin(); it != userWnds.end(); ++it){
if (!windows.empty())
windows += ',';
windows += number((*it)->id());
setWndConfig((*it)->id(), (*it)->getConfig().c_str());
}
setWindows(windows.c_str());
UserWnd *userWnd = m_tabBar->currentWnd();
if (userWnd)
setActiveWindow(userWnd->id());
saveGeometry(this, data.geometry);
saveToolbar(m_bar, data.barState);
if (m_tabBar->isVisible())
setStatusSize(m_status->width());
return save_data(containerData, &data);
}
QString Container::name()
{
UserWnd *wnd = m_tabBar->currentWnd();
if (wnd)
return wnd->getName();
return i18n("Container");
}
void Container::addUserWnd(UserWnd *wnd)
{
connect(wnd, SIGNAL(closed(UserWnd*)), this, SLOT(removeUserWnd(UserWnd*)));
connect(wnd, SIGNAL(statusChanged(UserWnd*)), this, SLOT(statusChanged(UserWnd*)));
m_wnds->addWidget(wnd, -1);
bool bBold = false;
for (list<msg_id>::iterator it = CorePlugin::m_plugin->unread.begin(); it != CorePlugin::m_plugin->unread.end(); ++it){
if ((*it).contact == wnd->id()){
bBold = true;
break;
}
}
QTab *tab = new UserTab(wnd, bBold);
m_tabBar->addTab(tab);
m_tabBar->setCurrentTab(tab);
contactSelected(0);
if ((m_tabBar->count() > 1) && !m_tabBar->isVisible()){
m_tabBar->show();
if (getStatusSize()){
QValueList<int> s;
s.append(1);
s.append(getStatusSize());
m_bStatusSize = true;
m_tabSplitter->setSizes(s);
m_bStatusSize = false;
}
m_tabSplitter->setResizeMode(m_status, QSplitter::KeepSize);
}
}
void Container::raiseUserWnd(UserWnd *wnd)
{
m_tabBar->raiseTab(wnd->id());
contactSelected(0);
}
void Container::removeUserWnd(UserWnd *wnd)
{
disconnect(wnd, SIGNAL(closed(UserWnd*)), this, SLOT(removeUserWnd(UserWnd*)));
disconnect(wnd, SIGNAL(statusChanged(UserWnd*)), this, SLOT(statusChanged(UserWnd*)));
m_wnds->removeWidget(wnd);
m_tabBar->removeTab(wnd->id());
if (m_tabBar->count() == 0)
QTimer::singleShot(0, this, SLOT(close()));
if (m_tabBar->count() == 1)
m_tabBar->hide();
contactSelected(0);
}
UserWnd *Container::wnd(unsigned id)
{
return m_tabBar->wnd(id);
}
UserWnd *Container::wnd()
{
return m_tabBar->currentWnd();
}
void Container::showBar()
{
BarShow b;
b.bar_id = ToolBarContainer;
b.parent = this;
Event e(EventShowBar, &b);
m_bar = (CToolBar*)e.process();
m_bBarChanged = true;
restoreToolbar(m_bar, data.barState);
m_bar->show();
m_bBarChanged = false;
contactSelected(0);
}
void Container::init()
{
if (m_bInit)
return;
m_bInit = true;
showBar();
string windows = getWindows();
while (!windows.empty()){
unsigned long id = atol(getToken(windows, ',').c_str());
Contact *contact = getContacts()->contact(id);
if (contact == NULL)
continue;
addUserWnd(new UserWnd(id, getWndConfig(id), false));
}
if (m_tabBar->count() == 0)
QTimer::singleShot(0, this, SLOT(close()));
setWindows(NULL);
clearWndConfig();
m_tabBar->raiseTab(getActiveWindow());
show();
}
void Container::contactSelected(int)
{
UserWnd *userWnd = m_tabBar->currentWnd();
if (userWnd == NULL)
return;
m_wnds->raiseWidget(userWnd);
m_bar->setParam((void*)userWnd->id());
QString name = userWnd->getName();
Command cmd;
cmd->id = CmdContainerContact;
cmd->text_wrk = strdup(name.utf8());
cmd->icon = userWnd->getIcon();
cmd->param = (void*)(userWnd->id());
cmd->popup_id = MenuContainerContact;
cmd->flags = BTN_PICT;
Event e(EventCommandChange, cmd);
m_bar->processEvent(&e);
setIcon(Pict(cmd->icon));
setCaption(name);
m_bar->checkState();
m_status->message(userWnd->status());
if (isActiveWindow())
userWnd->markAsRead();
}
void Container::setMessageType(unsigned type)
{
CommandDef *def;
for (;;){
def = CorePlugin::m_plugin->messageTypes.find(type);
if (def == NULL)
return;
MessageDef *mdef = (MessageDef*)(def->param);
if (mdef->base_type == 0)
break;
type = mdef->base_type;
}
Command cmd;
cmd->id = CmdMessageType;
cmd->text = def->text;
cmd->icon = def->icon;
cmd->bar_id = ToolBarContainer;
cmd->bar_grp = 0x2000;
cmd->menu_id = 0;
cmd->menu_grp = 0;
cmd->popup_id = MenuMessage;
cmd->flags = BTN_PICT;
Event eCmd(EventCommandChange, cmd);
m_bar->processEvent(&eCmd);
}
void Container::resizeEvent(QResizeEvent *e)
{
QMainWindow::resizeEvent(e);
if (m_bInSize)
return;
saveGeometry(this, data.geometry);
CorePlugin::m_plugin->data.containerSize[0] = data.geometry[2];
CorePlugin::m_plugin->data.containerSize[1] = data.geometry[3];
}
void Container::toolbarChanged(QToolBar*)
{
if (m_bBarChanged)
return;
saveToolbar(m_bar, data.barState);
memcpy(CorePlugin::m_plugin->data.containerBar, data.barState, sizeof(data.barState));
}
void Container::statusChanged(int width)
{
if (m_tabBar->isVisible() && !m_bStatusSize){
setStatusSize(width);
CorePlugin::m_plugin->setContainerStatusSize(width);
}
}
void Container::statusChanged(UserWnd *wnd)
{
if (wnd == m_tabBar->currentWnd())
m_status->message(wnd->status());
}
void Container::accelActivated(int id)
{
if ((unsigned)id >= ACCEL_MESSAGE){
Command cmd;
cmd->id = id - ACCEL_MESSAGE;
cmd->menu_id = MenuMessage;
cmd->param = (void*)(m_tabBar->currentWnd()->id());
Event e(EventCommandExec, cmd);
e.process();
return;
}
switch (id){
case 11:
m_tabBar->setCurrent(m_tabBar->current() - 1);
break;
case 12:
m_tabBar->setCurrent(m_tabBar->current() + 1);
break;
case 13:
m_tabBar->setCurrent(0);
break;
case 14:
m_tabBar->setCurrent(m_tabBar->count() - 1);
break;
default:
m_tabBar->setCurrent(id - 1);
}
}
static const char *accels[] =
{
"Alt+1",
"Alt+2",
"Alt+3",
"Alt+4",
"Alt+5",
"Alt+6",
"Alt+7",
"Alt+8",
"Alt+9",
"Alt+0"
};
#ifdef WIN32
extern bool bFullScreen;
typedef struct FLASHWINFO
{
unsigned long cbSize;
HWND hwnd;
unsigned long dwFlags;
unsigned long uCount;
unsigned long dwTimeout;
} FLASHWINFO;
static BOOL (WINAPI *FlashWindowEx)(FLASHWINFO*) = NULL;
static bool initFlash = false;
#endif
void *Container::processEvent(Event *e)
{
UserWnd *userWnd;
Contact *contact;
CommandDef *cmd;
Message *msg;
switch (e->type()){
case EventMessageReceived:
msg = (Message*)(e->param());
if (msg->type() == MessageStatus){
contact = getContacts()->contact(msg->contact());
if (contact)
contactChanged(contact);
return NULL;
}
if (CorePlugin::m_plugin->getContainerMode()){
if (isActiveWindow()){
userWnd = m_tabBar->currentWnd();
if (userWnd && (userWnd->id() == msg->contact()))
userWnd->markAsRead();
}
#ifdef WIN32
if (!isActiveWindow()){
msg = (Message*)(e->param());
userWnd = wnd(msg->contact());
if (userWnd){
if (!initFlash){
HINSTANCE hLib = GetModuleHandleA("user32");
if (hLib != NULL)
(DWORD&)FlashWindowEx = (DWORD)GetProcAddress(hLib,"FlashWindowEx");
initFlash = true;
}
if (FlashWindowEx){
FLASHWINFO fInfo;
fInfo.cbSize = sizeof(fInfo);
fInfo.dwFlags = 0x0E;
fInfo.hwnd = winId();
fInfo.uCount = 0;
FlashWindowEx(&fInfo);
}
}
}
#endif
}
case EventMessageRead:
msg = (Message*)(e->param());
userWnd = wnd(msg->contact());
if (userWnd){
bool bBold = false;
for (list<msg_id>::iterator it = CorePlugin::m_plugin->unread.begin(); it != CorePlugin::m_plugin->unread.end(); ++it){
if ((*it).contact != msg->contact())
continue;
bBold = true;
break;
}
m_tabBar->setBold(msg->contact(), bBold);
}
break;
case EventContactDeleted:
contact = (Contact*)(e->param());
userWnd = wnd(contact->id());
if (userWnd)
removeUserWnd(userWnd);
break;
case EventContactChanged:
contact = (Contact*)(e->param());
userWnd = wnd(contact->id());
if (userWnd)
m_tabBar->changeTab(contact->id());
case EventClientsChanged:
setupAccel();
break;
case EventContactStatus:
contact = (Contact*)(e->param());
userWnd = m_tabBar->wnd(contact->id());
if (userWnd){
unsigned style = 0;
string wrkIcons;
const char *statusIcon = NULL;
contact->contactInfo(style, statusIcon, &wrkIcons);
bool bTyping = false;
while (!wrkIcons.empty()){
if (getToken(wrkIcons, ',') == "typing"){
bTyping = true;
break;
}
}
if (userWnd->m_bTyping != bTyping){
userWnd->m_bTyping = bTyping;
if (bTyping){
userWnd->setStatus(i18n("Contact typed message"));
}else{
userWnd->setStatus("");
}
userWnd = m_tabBar->currentWnd();
if (userWnd && (contact->id() == userWnd->id()))
m_status->message(userWnd->status());
}
}
break;
case EventContactClient:
contactChanged((Contact*)(e->param()));
break;
case EventInit:
init();
break;
case EventCommandExec:
cmd = (CommandDef*)(e->param());
userWnd = m_tabBar->currentWnd();
if (userWnd && ((unsigned)(cmd->param) == userWnd->id())){
if (cmd->menu_id == MenuContainerContact){
m_tabBar->raiseTab(cmd->id);
return e->param();
}
if (cmd->id == CmdClose){
delete userWnd;
return e->param();
}
if (cmd->id == CmdInfo){
CommandDef c = *cmd;
c.menu_id = MenuContact;
c.param = (void*)userWnd->id();
Event eExec(EventCommandExec, &c);
eExec.process();
return e->param();
}
}
break;
case EventCheckState:
cmd = (CommandDef*)(e->param());
userWnd = m_tabBar->currentWnd();
if (userWnd && ((unsigned)(cmd->param) == userWnd->id()) &&
(cmd->menu_id == MenuContainerContact) &&
(cmd->id == CmdContainerContacts)){
list<UserWnd*> userWnds = m_tabBar->windows();
CommandDef *cmds = new CommandDef[userWnds.size() + 1];
memset(cmds, 0, sizeof(CommandDef) * (userWnds.size() + 1));
unsigned n = 0;
for (list<UserWnd*>::iterator it = userWnds.begin(); it != userWnds.end(); ++it){
cmds[n].id = (*it)->id();
cmds[n].flags = COMMAND_DEFAULT;
cmds[n].text_wrk = strdup((*it)->getName().utf8());
cmds[n].icon = (*it)->getIcon();
cmds[n].text = "_";
cmds[n].menu_id = n + 1;
if (n < sizeof(accels) / sizeof(const char*))
cmds[n].accel = accels[n];
if (*it == m_tabBar->currentWnd())
cmds[n].flags |= COMMAND_CHECKED;
n++;
}
cmd->param = cmds;
cmd->flags |= COMMAND_RECURSIVE;
return e->param();
}
break;
}
return NULL;
}
void Container::modeChanged()
{
if (isReceived() && CorePlugin::m_plugin->getContainerMode())
QTimer::singleShot(0, this, SLOT(close()));
if (CorePlugin::m_plugin->getContainerMode() == 0){
list<UserWnd*> wnds = m_tabBar->windows();
for (list<UserWnd*>::iterator it = wnds.begin(); it != wnds.end(); ++it){
if ((*it) != m_tabBar->currentWnd())
delete (*it);
}
}
}
void Container::wndClosed()
{
list<UserWnd*> wnds = m_tabBar->windows();
for (list<UserWnd*>::iterator it = wnds.begin(); it != wnds.end(); ++it){
if ((*it)->isClosed())
delete (*it);
}
}
bool Container::event(QEvent *e)
{
if (e->type() == QEvent::WindowActivate){
UserWnd *userWnd = m_tabBar->currentWnd();
if (userWnd)
userWnd->markAsRead();
if (m_bNoSwitch){
m_bNoSwitch = false;
}else{
if ((userWnd == NULL) || !m_tabBar->isBold(userWnd)){
list<UserWnd*> wnds = m_tabBar->windows();
for (list<UserWnd*>::iterator it = wnds.begin(); it != wnds.end(); ++it){
if (m_tabBar->isBold(*it)){
raiseUserWnd(*it);
break;
}
}
}
}
}
return QMainWindow::event(e);
}
void Container::contactChanged(Contact *contact)
{
UserWnd *userWnd = m_tabBar->currentWnd();
if (userWnd && (contact->id() == userWnd->id())){
QString name = userWnd->getName();
Command cmd;
cmd->id = CmdContainerContact;
cmd->text_wrk = strdup(name.utf8());
cmd->icon = userWnd->getIcon();
cmd->param = (void*)(contact->id());
cmd->popup_id = MenuContainerContact;
cmd->flags = BTN_PICT;
Event e(EventCommandChange, cmd);
m_bar->processEvent(&e);
setIcon(Pict(cmd->icon));
setCaption(name);
}
}
UserTabBar::UserTabBar(QWidget *parent) : QTabBar(parent)
{
setShape(QTabBar::TriangularBelow);
}
UserWnd *UserTabBar::wnd(unsigned id)
{
layoutTabs();
QList<QTab> *tList = tabList();
for (QTab *t = tList->first(); t; t = tList->next()){
UserTab *tab = static_cast<UserTab*>(t);
if (tab->wnd()->id() == id)
return tab->wnd();
}
return NULL;
}
void UserTabBar::raiseTab(unsigned id)
{
QList<QTab> *tList = tabList();
for (QTab *t = tList->first(); t; t = tList->next()){
UserTab *tab = static_cast<UserTab*>(t);
if (tab->wnd()->id() == id){
setCurrentTab(tab);
return;
}
}
}
list<UserWnd*> UserTabBar::windows()
{
list<UserWnd*> res;
unsigned n = count();
for (unsigned i = 0; n > 0; i++){
UserTab *t = static_cast<UserTab*>(tab(i));
if (t == NULL)
continue;
res.push_back(t->wnd());
n--;
}
return res;
}
void UserTabBar::setCurrent(unsigned n)
{
n++;
for (unsigned i = 0; n > 0; i++){
QTab *t = tab(i);
if (t == NULL)
continue;
if (--n == 0){
setCurrentTab(t);
}
}
}
unsigned UserTabBar::current()
{
unsigned n = 0;
for (unsigned i = 0; i < (unsigned)currentTab(); i++){
if (tab(i) == NULL)
continue;
n++;
}
return n;
}
void UserTabBar::removeTab(unsigned id)
{
layoutTabs();
QList<QTab> *tList = tabList();
for (QTab *t = tList->first(); t; t = tList->next()){
UserTab *tab = static_cast<UserTab*>(t);
if (tab == NULL)
continue;
if (tab->wnd()->id() == id){
QTabBar::removeTab(tab);
break;
}
}
}
void UserTabBar::changeTab(unsigned id)
{
layoutTabs();
QList<QTab> *tList = tabList();
for (QTab *t = tList->first(); t; t = tList->next()){
UserTab *tab = static_cast<UserTab*>(t);
if (tab->wnd()->id() == id){
tab->setText(tab->wnd()->getName());
break;
}
}
}
void UserTabBar::paintLabel(QPainter *p, const QRect &rc, QTab *t, bool bFocusRect) const
{
UserTab *tab = static_cast<UserTab*>(t);
if (tab->m_bBold){
QFont f = font();
f.setBold(true);
p->setFont(f);
}
QTabBar::paintLabel(p, rc, t, bFocusRect);
}
void UserTabBar::setBold(unsigned id, bool bBold)
{
QList<QTab> *tList = tabList();
for (QTab *t = tList->first(); t; t = tList->next()){
UserTab *tab = static_cast<UserTab*>(t);
if (tab->wnd()->id() == id){
if (tab->setBold(bBold))
repaint();
break;
}
}
}
bool UserTabBar::isBold(UserWnd *wnd)
{
QList<QTab> *tList = tabList();
for (QTab *t = tList->first(); t; t = tList->next()){
UserTab *tab = static_cast<UserTab*>(t);
if (tab->wnd() == wnd)
return tab->isBold();
}
return false;
}
void UserTabBar::mousePressEvent(QMouseEvent *e)
{
if (e->button() == RightButton){
QTab *t = selectTab(e->pos());
if (t == NULL) return;
UserTab *tab = static_cast<UserTab*>(t);
ProcessMenuParam mp;
mp.id = MenuContact;
mp.param = (void*)(tab->wnd()->id());
mp.key = 0;
Event eMenu(EventProcessMenu, &mp);
QPopupMenu *menu = (QPopupMenu*)eMenu.process();
if (menu)
menu->popup(e->globalPos());
return;
}
QTabBar::mousePressEvent(e);
}
UserWnd *UserTabBar::currentWnd()
{
QTab *t = tab(currentTab());
if (t == NULL)
return NULL;
return static_cast<UserTab*>(t)->m_wnd;
}
void UserTabBar::layoutTabs()
{
QTabBar::layoutTabs();
#if QT_VERSION < 300
QList<QTab> *tList = tabList();
for (QTab *t = tList->first(); t; t = tList->next()){
t->r.setHeight(height());
}
#endif
}
UserTab::UserTab(UserWnd *wnd, bool bBold)
: QTab(wnd->getName())
{
m_wnd = wnd;
m_bBold = bBold;
}
bool UserTab::setBold(bool bBold)
{
if (m_bBold == bBold)
return false;
m_bBold = bBold;
return true;
}
#ifndef WIN32
#include "container.moc"
#endif
| [
"shutoff@f7a67266-ba00-4dfb-90a2-3eec4ba07b7d"
] | shutoff@f7a67266-ba00-4dfb-90a2-3eec4ba07b7d |
604922130238684e1754543606148f78460d08db | 48e0f240d58ea8d84a86d86ba5be172e4b6a4523 | /src/main/Executor.hpp | 7abdd1265d176d229528d75f37841f79805d7981 | [] | no_license | kai-rothauge/alchemist | 6cdd5a681e925be3a3f1d03ed11f42569a9e5ae7 | 632e77a7fc6e345c054a4af8e667b2f471c5818f | refs/heads/master | 2020-03-10T02:49:01.246499 | 2018-07-04T00:19:19 | 2018-07-04T00:19:19 | 129,146,840 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,457 | hpp | #ifndef ALCHEMIST__EXECUTOR_HPP
#define ALCHEMIST__EXECUTOR_HPP
#include <omp.h>
#include <dlfcn.h>
#include <ctime>
#include <iostream>
#include <string>
#include <unistd.h>
#include "Alchemist.hpp"
#include "utility/logging.hpp"
namespace alchemist {
using std::string;
typedef std::shared_ptr<Library> Library_ptr;
struct LibraryInfo {
LibraryInfo() :
name(" "), path(" "), lib_ptr(nullptr), lib(nullptr) { }
LibraryInfo(std::string _name, std::string _path, void * _lib_ptr, Library_ptr _lib) :
name(_name), path(_path), lib_ptr(_lib_ptr), lib(_lib) { }
std::string name;
std::string path;
void * lib_ptr;
Library_ptr lib;
};
class Executor : public std::enable_shared_from_this<Executor>
{
public:
MPI_Comm & world;
MPI_Comm & peers;
std::map<std::string, LibraryInfo> libraries;
Executor(MPI_Comm & _world, MPI_Comm & _peers) : world(_world), peers(_peers) {}
virtual ~Executor() {}
// void set_log(Log_ptr _log);
// virtual int process_input_parameters(Parameters &) = 0;
// virtual int process_output_parameters(Parameters &) = 0;
int load_library(std::string);
int run_task(std::string, Parameters &);
int unload_libraries();
// int receive_new_matrix();
// int get_transpose();
// int matrix_multiply();
// int get_matrix_rows();
// int read_HDF5();
void deserialize_parameters(std::string, Parameters &);
std::string serialize_parameters(const Parameters &) const;
//
//private:
// Log_ptr log;
};
}
#endif
| [
"kai.rothauge@yahoo.com"
] | kai.rothauge@yahoo.com |
7bf82fa0271257dee178803b556be4bb7f823912 | 938e4888840de783c74cd6bcf0a44443472054dd | /gammacombo/src/PDF_GLWADS_DKpipi_hh_Dmix.cpp | 48e2309e944ace49c5bce3f5501474d660d83dbd | [] | no_license | ppodolsky/pygammacombo | 1922fb541a8d48f3b08558c1552053e2cf6017cd | fa52d2cda49694de36deb13e235f4e0801fd0fe5 | refs/heads/master | 2021-01-14T08:57:06.796747 | 2016-02-14T05:39:59 | 2016-02-14T05:39:59 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,052 | cpp | /**
* Gamma Combination
* Author: Till Moritz Karbach, moritz.karbach@cern.ch
* Date: Jul 2014
*
* The B->DKpipi, D->hh, GLW/ADS measurement: B->DKpipi, with D->Kpi, piK, pipi, KK,
* 6 observables, including D mixing.
**/
#include "PDF_GLWADS_DKpipi_hh_Dmix.h"
PDF_GLWADS_DKpipi_hh_Dmix::PDF_GLWADS_DKpipi_hh_Dmix(config cObs, config cErr, config cCor,
double Mxy)
: PDF_GLWADS_DKpipi_hh(cObs,cErr,cCor)
{
name = "GLWADS-Dkpipi-hh-dmix";
_Mxy = Mxy;
initParameters();
initRelations();
// initObservables();
// setObservables(cObs);
// setUncertainties(cErr);
// setCorrelations(cCor);
// buildCov();
delete pdf; // it was built already by the super class constructor
buildPdf();
}
PDF_GLWADS_DKpipi_hh_Dmix::~PDF_GLWADS_DKpipi_hh_Dmix(){}
void PDF_GLWADS_DKpipi_hh_Dmix::initParameters()
{
parameters->add(*(p->get("xD")));
parameters->add(*(p->get("yD")));
}
void PDF_GLWADS_DKpipi_hh_Dmix::initRelations()
{
RooArgSet *p = (RooArgSet*)parameters;
delete theory; theory = new RooArgList("theory"); ///< the order of this list must match that of the COR matrix!
RooRealVar& rbk = *((RooRealVar*)p->find("r_dkpipi"));
RooRealVar& dbk = *((RooRealVar*)p->find("d_dkpipi"));
RooRealVar& kbk = *((RooRealVar*)p->find("k_dkpipi"));
RooConstVar& kf = RooConst(1);
RooRealVar& rf = *((RooRealVar*)p->find("rD_kpi"));
RooConstVar& rfGLW = RooConst(1);
RooConstVar& rfRCP = RooConst(0);
RooRealVar& df = *((RooRealVar*)p->find("dD_kpi"));
RooConstVar& dfGLW = RooConst(0);
RooRealVar& g = *((RooRealVar*)p->find("g"));
RooRealVar& xD = *((RooRealVar*)p->find("xD"));
RooRealVar& yD = *((RooRealVar*)p->find("yD"));
RooRealVar& AcpDKK = *((RooRealVar*)p->find("AcpDKK"));
RooRealVar& AcpDpp = *((RooRealVar*)p->find("AcpDpipi"));
RooConstVar& AcpD = RooConst(0);
// theory->add(*(new RooFormulaVar("rcp_dkpipi_th", "rcp_dkpipi_th", "1 + r_dkpipi^2 + 2*k_dkpipi*r_dkpipi*cos(d_dkpipi)*cos(g)", *p)));
// theory->add(*(new RooFormulaVar("afav_dkpipi_kpi_th", "afav_dkpipi_kpi_th", "2*k_dkpipi *r_dkpipi *rD_kpi*sin(g)*sin(d_dkpipi -dD_kpi) / (1 + r_dkpipi^2 * rD_kpi^2 + 2*k_dkpipi *r_dkpipi *rD_kpi*cos(g)*cos(d_dkpipi -dD_kpi))", *p)));
// theory->add(*(new RooFormulaVar("acp_dkpipi_kk_th", "acp_dkpipi_kk_th", "2*k_dkpipi *r_dkpipi *sin(d_dkpipi) *sin(g) / (1 + r_dkpipi^2 + 2*k_dkpipi *r_dkpipi *cos(d_dkpipi) *cos(g)) + AcpDKK", *p)));
// theory->add(*(new RooFormulaVar("acp_dkpipi_pipi_th", "acp_dkpipi_pipi_th", "2*k_dkpipi *r_dkpipi *sin(d_dkpipi) *sin(g) / (1 + r_dkpipi^2 + 2*k_dkpipi *r_dkpipi *cos(d_dkpipi) *cos(g)) + AcpDpipi", *p)));
// theory->add(*(new RooFormulaVar("rp_dkpipi_th", "rp_dkpipi_th", "(r_dkpipi^2 + rD_kpi^2 + 2*k_dkpipi *r_dkpipi *rD_kpi*cos( g+d_dkpipi +dD_kpi)) / (1 + r_dkpipi^2 *rD_kpi^2 + 2*k_dkpipi *r_dkpipi *rD_kpi*cos( g +d_dkpipi -dD_kpi))", *p)));
// theory->add(*(new RooFormulaVar("rm_dkpipi_th", "rm_dkpipi_th", "(r_dkpipi^2 + rD_kpi^2 + 2*k_dkpipi *r_dkpipi *rD_kpi*cos(-g+d_dkpipi +dD_kpi)) / (1 + r_dkpipi^2 *rD_kpi^2 + 2*k_dkpipi *r_dkpipi *rD_kpi*cos(-g +d_dkpipi -dD_kpi))", *p)));
theory->add(*(new RooGLWADSDmixRcpVar("rcp_dkpipi_th", "RooGLWADSDmixRcpVar", rbk, dbk, kbk, rfRCP, dfGLW, kf, g, xD, yD, _Mxy)));
theory->add(*(new RooGLWADSDmixAcpVar("afav_dkpipi_kpi_th", "RooGLWADSDmixAcpVar", rbk, dbk, kbk, rf, df, kf, g, xD, yD, _Mxy, AcpD)));
theory->add(*(new RooGLWADSDmixAcpVar("acp_dkpipi_kk_th", "RooGLWADSDmixAcpVar", rbk, dbk, kbk, rfGLW, dfGLW, kf, g, xD, yD, _Mxy, AcpDKK)));
theory->add(*(new RooGLWADSDmixAcpVar("acp_dkpipi_pipi_th", "RooGLWADSDmixAcpVar", rbk, dbk, kbk, rfGLW, dfGLW, kf, g, xD, yD, _Mxy, AcpDpp)));
theory->add(*(new RooGLWADSDmixRpmVar("rp_dkpipi_th", "RooGLWADSDmixRpmVar", rbk, dbk, kbk, rf, df, kf, g, xD, yD, _Mxy, "+")));
theory->add(*(new RooGLWADSDmixRpmVar("rm_dkpipi_th", "RooGLWADSDmixRpmVar", rbk, dbk, kbk, rf, df, kf, g, xD, yD, _Mxy, "-")));
}
| [
"ppodolsky@me.com"
] | ppodolsky@me.com |
b52f9b6b00341eec2aef65ed1ec95626585e98d0 | f9b3e83fcdee3080ee9cf5f24bf0e76e6a33e748 | /src/25_1_blinn_phong.cpp | 8e6a84d20fdfc00c6629e6cc7a969f931bea67d2 | [] | no_license | SahilMadan/learngl | 1caf27196083e2467083c8ad1fd052e8269589ba | d3af961396d1ca2f289e20430101c6e047bad6c3 | refs/heads/master | 2023-08-27T17:51:27.526079 | 2021-11-10T03:23:19 | 2021-11-10T03:23:19 | 400,278,368 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,234 | cpp | #include <glad/glad.h>
// Do not sort above glad
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <iostream>
#include "camera.hpp"
#include "model.hpp"
#include "shader_m.hpp"
#include "stb_include.hpp"
// Default settings
constexpr unsigned int kScreenWidth = 800;
constexpr unsigned int kScreenHeight = 600;
// Function declarations
void FramebufferSizeCallback(GLFWwindow* window, int width, int height);
void ProcessInput(GLFWwindow* window);
void MouseCursorCallback(GLFWwindow* window, double x_position,
double y_position);
void MouseScrollCallback(GLFWwindow* window, double x_offset, double y_offset);
unsigned int LoadTexture(char const* path);
// Time between current frame and last frame
float delta_time = 0.0f;
// The time of the last frame
float last_frame = 0.0f;
// Mouse position
float mouse_last_x = 400;
float mouse_last_y = 300;
bool first_mouse_position = true;
// Blinn shading
bool use_blinn = false;
bool blinn_key_pressed = false;
float specular_exponent = 8.5;
bool specular_increase_pressed = false;
bool specular_decrease_pressed = false;
Camera camera(glm::vec3(0.0f, 0.0f, 3.0f));
int main() {
// Initialize and configure GLFW
glfwInit();
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
// Create a GLFW window
GLFWwindow* window = glfwCreateWindow(kScreenWidth, kScreenHeight,
"LearnOpenGL", nullptr, nullptr);
if (window == nullptr) {
std::cerr << "Failed to create GLFW window\n";
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
glfwSetFramebufferSizeCallback(window, FramebufferSizeCallback);
glfwSetCursorPosCallback(window, MouseCursorCallback);
glfwSetScrollCallback(window, MouseScrollCallback);
// Disable the cursor and capture it
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
// Load all OpenGL function pointers
// Note that this must be called after MakeContextCurrent
if (!gladLoadGLLoader(reinterpret_cast<GLADloadproc>(glfwGetProcAddress))) {
std::cerr << "Failed to initialize GLAD\n";
return -1;
}
// Configure global OpenGL state to include z-buffer depth testing
glEnable(GL_DEPTH_TEST);
// Tell stb_image.h to flip loaded texture's on the y-axis (before loading
// model).
stbi_set_flip_vertically_on_load(true);
Shader shader("shaders/25_1_blinn_phong.vs", "shaders/25_1_blinn_phong.fs");
// Position (x, y, z), normals (x, y, z), texture coordinates (s, t)
// Note: Texture coordinates set higher than (together with GL_REPEAT) to
// cause floor repeat.
float plane_vertices[] = {
10.0f, -0.5f, 10.0f, 0.0f, 1.0f, 0.0f, 10.0f, 0.0f, //
-10.0f, -0.5f, 10.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, //
-10.0f, -0.5f, -10.0f, 0.0f, 1.0f, 0.0f, 0.0f, 10.0f, //
10.0f, -0.5f, 10.0f, 0.0f, 1.0f, 0.0f, 10.0f, 0.0f, //
-10.0f, -0.5f, -10.0f, 0.0f, 1.0f, 0.0f, 0.0f, 10.0f, //
10.0f, -0.5f, -10.0f, 0.0f, 1.0f, 0.0f, 10.0f, 10.0f //
};
// Plane VAO
unsigned int plane_vao;
glGenVertexArrays(1, &plane_vao);
glBindVertexArray(plane_vao);
unsigned int plane_vbo;
glGenBuffers(1, &plane_vbo);
glBindBuffer(GL_ARRAY_BUFFER, plane_vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(plane_vertices), &plane_vertices,
GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)0);
glEnableVertexAttribArray(0);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(float),
(void*)(3 * sizeof(float)));
glEnableVertexAttribArray(1);
glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 8 * sizeof(float),
(void*)(6 * sizeof(float)));
glEnableVertexAttribArray(2);
glBindVertexArray(0);
// Load textures
auto floor_texture = LoadTexture("assets/textures/wood.png");
// Shader config
shader.Use();
shader.SetInt("floor_texture", 0);
// Lighting info
glm::vec3 light_position(0.0f, 0.0f, 0.0f);
// Render loop
while (!glfwWindowShouldClose(window)) {
// Calculate delta time
// People's machines have different processing powers and are able to render
// much more frames. This results in some people moving really fast and
// others really slow. To account for this, we should calculate
// physics/movement based on the time difference between the two frames.
float current_frame = glfwGetTime();
delta_time = current_frame - last_frame;
last_frame = current_frame;
// Input
ProcessInput(window);
// Render
glClearColor(0.1f, 0.1f, 0.1f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
shader.Use();
// Using lookAt...
auto view = camera.GetViewMatrix();
shader.SetMat4("view", view);
// Use perspective projection
glm::mat4 projection;
projection = glm::perspective(
glm::radians(camera.GetFieldOfView()),
static_cast<float>(kScreenWidth) / static_cast<float>(kScreenHeight),
0.1f, 100.0f);
shader.SetMat4("projection", projection);
// Set light uniforms
shader.SetVec3("viewPosition", camera.Position());
shader.SetVec3("lightPosition", light_position);
shader.SetInt("blinn", use_blinn);
shader.SetFloat("specularExponent", specular_exponent);
// Floor
glBindVertexArray(plane_vao);
glBindTexture(GL_TEXTURE_2D, floor_texture);
shader.SetMat4("model", glm::mat4(1.0f));
glDrawArrays(GL_TRIANGLES, 0, 6);
glBindVertexArray(0);
// Swap buffers and poll I/O events (keys pressed, mouse moved, etc.)
glfwSwapBuffers(window);
glfwPollEvents();
}
// Terminate, clearing all previously allocated GLFW resources
glfwTerminate();
return 0;
}
void ProcessInput(GLFWwindow* window) {
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS) {
glfwSetWindowShouldClose(window, true);
return;
}
if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS) {
camera.ProcessMovement(CameraMovement::FORWARD, delta_time);
}
if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS) {
camera.ProcessMovement(CameraMovement::BACKWARD, delta_time);
}
if (glfwGetKey(window, GLFW_KEY_A) == GLFW_PRESS) {
camera.ProcessMovement(CameraMovement::LEFT, delta_time);
}
if (glfwGetKey(window, GLFW_KEY_D) == GLFW_PRESS) {
camera.ProcessMovement(CameraMovement::RIGHT, delta_time);
}
if (glfwGetKey(window, GLFW_KEY_B) == GLFW_PRESS && !blinn_key_pressed) {
blinn_key_pressed = true;
use_blinn = !use_blinn;
}
if (glfwGetKey(window, GLFW_KEY_B) == GLFW_RELEASE) {
blinn_key_pressed = false;
}
if (glfwGetKey(window, GLFW_KEY_K) == GLFW_PRESS &&
!specular_increase_pressed) {
specular_increase_pressed = true;
specular_exponent += 1.0f;
}
if (glfwGetKey(window, GLFW_KEY_K) == GLFW_RELEASE) {
specular_increase_pressed = false;
}
if (glfwGetKey(window, GLFW_KEY_J) == GLFW_PRESS &&
!specular_decrease_pressed) {
specular_decrease_pressed = true;
specular_exponent -= 1.0f;
if (specular_exponent < 0.5f) specular_exponent = 0.5f;
}
if (glfwGetKey(window, GLFW_KEY_J) == GLFW_RELEASE) {
specular_decrease_pressed = false;
}
}
void FramebufferSizeCallback(GLFWwindow*, int width, int height) {
// Make sure the viewport matches the new window dimensions.
glViewport(0, 0, width, height);
}
void MouseCursorCallback(GLFWwindow*, double x_position, double y_position) {
if (first_mouse_position) {
first_mouse_position = false;
mouse_last_x = x_position;
mouse_last_y = y_position;
return;
}
float x_offset = x_position - mouse_last_x;
float y_offset = (y_position - mouse_last_y) * -1;
mouse_last_x = x_position;
mouse_last_y = y_position;
camera.ProcessLook(x_offset, y_offset);
}
void MouseScrollCallback(GLFWwindow*, double /*x_offset*/, double y_offset) {
camera.ProcessFieldOfView(y_offset);
}
unsigned int LoadTexture(char const* path) {
unsigned int texture_id;
glGenTextures(1, &texture_id);
int width;
int height;
int component_count;
auto* data = stbi_load(path, &width, &height, &component_count, 0);
if (data) {
GLenum format;
switch (component_count) {
case 1:
format = GL_RED;
break;
case 3:
format = GL_RGB;
break;
case 4:
format = GL_RGBA;
break;
};
glBindTexture(GL_TEXTURE_2D, texture_id);
glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, format,
GL_UNSIGNED_BYTE, data);
glGenerateMipmap(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
stbi_image_free(data);
} else {
std::cerr << "Texture failed to load at path: " << path << "\n";
stbi_image_free(data);
}
return texture_id;
}
| [
"Hillatio@gmail.com"
] | Hillatio@gmail.com |
7faf6c89325ffdc4d38837ec9b6bf54659271318 | f11b6b83b868d6a06cd2c5510d34bc96519bb1e8 | /(훈련반1) Level19 - 문제4번.cpp | c0cc8dd1f9d09627e76d2b300f4a6c7938a1daa8 | [] | no_license | JuicyJerry/mincoding | c2ea35d5ce29ded5c3f4378bdb2267225643cfb6 | 238882ff59ead0f515613e6fe4879584b98da038 | refs/heads/master | 2022-12-23T15:18:20.239179 | 2020-09-22T14:34:05 | 2020-09-22T14:34:05 | 260,839,290 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 177 | cpp | #include <iostream>
using namespace std;
int main() {
int G;
cin >> G;
int* k = &G;
int* p = &G;
int** t = &p;
int** Q = &k;
cout << **t << " " << *k;
return 0;
}
| [
"ju2cyjerry@gmail.com"
] | ju2cyjerry@gmail.com |
cc3219b5da2053f2f6e1ec1bf89097396e2fb99c | a14badc58bc6b5871cbd85e91cd8bf636824acec | /Maths/ReverseInteger.cpp | 14853a4025658bfea9b42036b759c642581e2ad5 | [] | no_license | prashant97sikarwar/Interview-Bit | 693b37c15e70de346c58debfd18e22541aaf7452 | 4b3bf032e30e16b8033e1a47c840fcaa434be429 | refs/heads/master | 2023-07-16T17:02:58.297411 | 2021-08-31T11:35:39 | 2021-08-31T11:35:39 | 353,809,557 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 529 | cpp | //Problem Link:- https://www.interviewbit.com/problems/reverse-integer/
#include<bits/stdc++.h>
using namespace std;
int reverse(int num) {
int sign;
sign = (num >= 0) ? 1 : -1;
long long int rev = 0;
num = abs(num);
while (num > 0){
int rem = num % 10;
rev = 10 * rev + rem;
if (sign*rev > INT_MAX || sign*rev < INT_MIN){
return 0;
}
num /= 10;
}
rev = sign*rev;
if (rev > INT_MAX || rev < INT_MIN){
return 0;
}
return rev;
}
| [
"prashant97sikarwar@gmail.com"
] | prashant97sikarwar@gmail.com |
f5eabca4e396fbf865adc15e049e9aa43da8963e | e5a9b2730f681ee4218f76c3519203c80318b4cf | /AnalyzerForTests/Analyzer/plugins/Analyzer.h | 15271650f5fade3ce4df82b7ac6634d3a257d2dd | [] | no_license | luciegzzz/UserCode | 43f30512526cde6282e34b67077b2b94274b9fe4 | 1aa5d3528c43ef5693221a5adc88e5f5d533d52b | refs/heads/master | 2021-01-02T08:09:53.986282 | 2012-12-06T16:16:37 | 2012-12-06T16:16:37 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,199 | h | // -*- C++ -*-
//
// Package: Analyzer
// Class: Analyzer
//
/**\class Analyzer Analyzer.cc /Analyzer/plugins/Analyzer.cc
Description: [one line class summary]
Implementation:
[Notes on implementation]
*/
//
// Original Author: "Lucie Gauthier"
//
// $Id: Analyzer.h,v 1.8 2011/04/21 12:15:14 lucieg Exp $
//
//
#ifndef AnalyzerForTests_Analyzer_Analyzer_
#define AnalyzerForTests_Analyzer_Analyzer_
// system include files
#include <memory>
#include <string>
#include <vector>
// user include files
//CMSSW includes
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "DataFormats/Common/interface/Handle.h"
#include <DataFormats/PatCandidates/interface/Electron.h>
#include "DataFormats/Math/interface/deltaR.h"
#include "DataFormats/Common/interface/ValueMap.h"
#include "AnalysisDataFormats/CMGTools/interface/Electron.h"
//ROOT includes
#include "TFile.h"
#include "TH1F.h"
#include "TH2F.h"
#include "TF1.h"
#include "TTree.h"
//
// class declaration
//
class Analyzer : public edm::EDAnalyzer {
public:
explicit Analyzer(const edm::ParameterSet&);
~Analyzer();
private:
virtual void beginJob() ;
virtual void analyze(const edm::Event&, const edm::EventSetup&);
virtual void endJob() ;
// ----------member data ---------------------------
edm::InputTag inputTagElectrons_;
edm::InputTag inputTagCmgElectrons_;
//output
TFile *outputFile_;
std::string fOutputFileName_;
// tree & its variables
TTree* eleTree_;
double deltaR_;
double ptReco_;
double ptGen_;
double etaReco_;
double etaGen_;
};
#endif
| [
""
] | |
d47abdf9dae082ddab38031d94331ec09cdc7c33 | 9bc92c4616d4dc30918b54e99bd0ece08c77ce11 | /project/Project77/days.cpp | 418969492d1c4bf33e776180ac25396fc9931160 | [] | no_license | StasBeep/programs-CPP-Lafore | 90977d7de9291992c2454c1b93a0f38c445b2ccb | 3771c5c86f0786d77e07c5c46e2909b7c366a03b | refs/heads/main | 2023-03-19T06:52:36.182806 | 2021-03-06T00:14:09 | 2021-03-06T00:14:09 | 344,962,693 | 0 | 0 | null | null | null | null | MacCyrillic | C++ | false | false | 708 | cpp | // days.cpp
// показ количества дней с начала года и до введЄнной даты
#include <iostream>
using namespace std;
///// int main() //////////////////////////////////////////////////////
int main()
{
setlocale(LC_ALL, "Russian");
int month, day, total_days;
int days_per_month[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
cout << "¬ведите мес€ц (от 1 до 12): ";
cin >> month;
cout << "¬ведите день (от 1 до 31): ";
cin >> day;
total_days = day;
for (int j = 0; j < month - 1; j++)
total_days += days_per_month[j];
cout << "ќбщее число дней с начала года: " << total_days << endl;
return 0;
} | [
"stas-stas.stanislav@mail.ru"
] | stas-stas.stanislav@mail.ru |
b97c56da0a125afbee0c6168b6e05e7a14cbbd91 | f6582741d4999660850606c11d7299476bff74cc | /example/engines/interface.cpp | 63f4a0ac190ebbc7c768a18f7fac494a186fd6be | [] | no_license | mezdej/cpp | 6f72faf02a7e8a4c35607003ebd170281829f8cb | 89856d3872864d1cbc78b69624da95cc24daf378 | refs/heads/master | 2021-06-10T20:03:55.789827 | 2021-04-06T19:39:46 | 2021-04-06T19:39:46 | 172,216,990 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 593 | cpp | #include "interface.h"
#include "../network/url.h"
#include "mock.h"
#include "rest.h"
#include <boost/beast/http/parser.hpp>
namespace example
{
namespace engine
{
Interface::Pointer Interface::Get( const string & endpoint, const string & login, const string & password )
{
network::Url url( endpoint );
if( url.protocol.empty() == false )
{
//todo: return interface by protocol
if( url.protocol == "mock" )
return Interface::Pointer( new Mock( endpoint, login, password ) );
}
return Interface::Pointer( new Rest( endpoint, login, password ) );
}
}
} | [
"mezdej@wp.pl"
] | mezdej@wp.pl |
b8c63f711b48d1f86b71e816287299396a10c88d | 11b5e6d606ff54af708214e161756e35c8439f65 | /Week5/IslandPerimeter.cpp | 6034362c57f99d04cd20ff997a4e3e5922468a01 | [] | no_license | hannesphillips/Wallbreakers | 9c7d0c39aa66b3c706d5cdbd04ca5c0664bed233 | e02d863799eed93b9fc99d3bb6440942c5bb35f0 | refs/heads/master | 2020-06-10T13:42:18.698560 | 2019-07-30T02:13:03 | 2019-07-30T02:13:03 | 193,642,584 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 969 | cpp | class Solution {
public:
int islandPerimeter(vector<vector<int>>& grid) {
if(grid.empty()) return 0;
if(grid[0].empty()) return 0;
int perim = 0;
int r = grid.size();
int c = grid[0].size();
// Pad edges with 0s (water)
vector<int> fill (c+2, 0);
grid.push_back(fill);
grid.insert(grid.begin(), fill);
for(int i = 0; i < r; i++) {
grid[i+1].push_back(0);
grid[i+1].insert(grid[i+1].begin(), 0);
}
/* Scan neighboring cells. If neighbor is
land mass, 1 less edge accounts to perimeter */
for(int i = 1; i < r+1; i++) {
for(int j = 1; j < c+1; j++) {
if(grid[i][j]) {
perim += 4 - (grid[i-1][j] + grid[i+1][j] +
grid[i][j-1] + grid[i][j+1]);
}
}
}
return perim;
}
}; | [
"ec2-user@ip-172-31-26-155.us-east-2.compute.internal"
] | ec2-user@ip-172-31-26-155.us-east-2.compute.internal |
8115f11dbca14bb1b560b6fdbc65ba407a9d8685 | c5b85b82eb35fb1daeb08979617c9ac905bffbd6 | /engine/headers/hitbox.h | f0a18373fefc7066219d6b15bccfb345d21f71b6 | [] | no_license | whcampbell/Wizart-Gaem | 19a758758e53a763248a3f2ca67371a62b4e6380 | eea8b84710810e5406b80243f99a27570f44f804 | refs/heads/master | 2023-02-21T05:59:17.737789 | 2021-01-14T20:35:29 | 2021-01-14T20:35:29 | 296,431,319 | 0 | 0 | null | 2021-01-07T21:15:32 | 2020-09-17T20:08:45 | C++ | UTF-8 | C++ | false | false | 802 | h | #pragma once
#include "alignment.h"
/**
* struct representing a rectanglar region which can detect overlap with other regions
*/
struct Hitbox
{
int xoff = 0, yoff = 0;
int w, h;
Alignment* align;
};
namespace hitbox {
/**
* checks if the input hitboxes overlap
*
* Hitbox* a1 - the first hitbox
* Hitbox* a2 - the second hitbox
* returns - true if the hitboxes overlap, and false otherwise
*/
bool collision(Hitbox* a1, Hitbox* a2);
/**
* draws an outline around the hitbox location
*
* Hitbox* h - pointer to the hitbox to draw
* int xoff - x offset of the hitbox to draw
* int yoff - y offset of the hitbox to draw
*/
void render(Hitbox* h, int xoff, int yoff);
}
| [
"pmkgbwis@gmail.com"
] | pmkgbwis@gmail.com |
251ee25fcc2cac1da51db5a591b9a091898a0878 | 24f26275ffcd9324998d7570ea9fda82578eeb9e | /media/gpu/video_frame_converter.cc | 30df4fa769f7e028774c042a05a09072b254818f | [
"BSD-3-Clause"
] | permissive | Vizionnation/chromenohistory | 70a51193c8538d7b995000a1b2a654e70603040f | 146feeb85985a6835f4b8826ad67be9195455402 | refs/heads/master | 2022-12-15T07:02:54.461083 | 2019-10-25T15:07:06 | 2019-10-25T15:07:06 | 217,557,501 | 2 | 1 | BSD-3-Clause | 2022-11-19T06:53:07 | 2019-10-25T14:58:54 | null | UTF-8 | C++ | false | false | 1,129 | cc | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/gpu/video_frame_converter.h"
namespace media {
VideoFrameConverter::VideoFrameConverter() = default;
VideoFrameConverter::~VideoFrameConverter() = default;
void VideoFrameConverter::Destroy() {
delete this;
}
void VideoFrameConverter::Initialize(
scoped_refptr<base::SequencedTaskRunner> parent_task_runner,
OutputCB output_cb) {
parent_task_runner_ = std::move(parent_task_runner);
output_cb_ = std::move(output_cb);
}
void VideoFrameConverter::ConvertFrame(scoped_refptr<VideoFrame> frame) {
DCHECK(parent_task_runner_->RunsTasksInCurrentSequence());
DCHECK(output_cb_);
output_cb_.Run(std::move(frame));
}
void VideoFrameConverter::AbortPendingFrames() {}
bool VideoFrameConverter::HasPendingFrames() const {
return false;
}
} // namespace media
namespace std {
void default_delete<media::VideoFrameConverter>::operator()(
media::VideoFrameConverter* ptr) const {
ptr->Destroy();
}
} // namespace std
| [
"rjkroege@chromium.org"
] | rjkroege@chromium.org |
cec666cb523f60a89d7582ce809128d2d7359ab7 | 1f41b828fb652795482cdeaac1a877e2f19c252a | /maya_plugins/inLocus/chRig/sgPsdJointBase/sgPsdJointBase/deleteIndex.h | 05537b096e0405432ca11136cff5f2ef9cf56aba | [] | no_license | jonntd/mayadev-1 | e315efe582ea433dcf18d7f1e900920f5590b293 | f76aeecb592df766d05a4e10fa2c2496f0310ca4 | refs/heads/master | 2021-05-02T07:16:17.941007 | 2018-02-05T03:55:12 | 2018-02-05T03:55:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,143 | h | #ifndef _deleteIndex_h
#define _deleteIndex_h
#include <maya/MPxCommand.h>
#include <maya/MSyntax.h>
#include <maya/MArgList.h>
#include <maya/MArgDatabase.h>
#include <maya/MSelectionList.h>
#include <maya/MObject.h>
#include <maya/MObjectArray.h>
#include <maya/MFnDagNode.h>
#include <maya/MPlug.h>
#include <maya/MPlugArray.h>
#include <maya/MFnDependencyNode.h>
#include <maya/MPoint.h>
#include <maya/MPointArray.h>
#include <maya/MIntArray.h>
#include <maya/MFloatArray.h>
#include <maya/MMatrix.h>
#include <maya/MMatrixArray.h>
#include <maya/MString.h>
#include <maya/MFnAttribute.h>
#include <maya/MGlobal.h>
#include <maya/MDGModifier.h>
#include <maya/MString.h>
class DeleteIndex : MPxCommand
{
public:
DeleteIndex();
virtual ~DeleteIndex();
MStatus doIt( const MArgList& args );
MStatus redoIt();
MStatus undoIt();
bool isUndoable() const;
static MSyntax newSyntax();
static void* creator();
public:
MObject m_oNode;
int m_indexTarget;
MPlug m_plugTarget;
MString m_namePlug;
MString m_shapeName;
float m_weight;
MPointArray m_deltas;
MIntArray m_logicalIndices;
};
#endif | [
"kimsung9k@naver.com"
] | kimsung9k@naver.com |
45a2631031d434dd8c390a83dc3e04ffb2183a86 | ecba1c965423e5783c12a0eae359803a8cfbc042 | /RPG_V1/Source/RPG_V1/Private/Characters/Abilities/RPGAsyncTaskCooldownChanged.cpp | 6ab569e8ecdbf16ecd7b920572183921a8e4840c | [] | no_license | Globins/UE4GASRPG | ae6b199f3dbabb8a1a7818484030d8c282845867 | 2dc0bedbcd2446fcff1abd43331548ab2c7bc8ba | refs/heads/master | 2023-01-01T02:36:20.415676 | 2020-10-20T18:37:20 | 2020-10-20T18:37:20 | 305,798,876 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,700 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "Characters\Abilities\RPGAsyncTaskCooldownChanged.h"
URPGAsyncTaskCooldownChanged* URPGAsyncTaskCooldownChanged::ListenForCooldownChange(UAbilitySystemComponent* AbilitySystemComponent, FGameplayTagContainer InCooldownTags, bool InUseServerCooldown)
{
URPGAsyncTaskCooldownChanged* ListenForCooldownChange = NewObject<URPGAsyncTaskCooldownChanged>();
ListenForCooldownChange->ASC = AbilitySystemComponent;
ListenForCooldownChange->CooldownTags = InCooldownTags;
ListenForCooldownChange->UseServerCooldown = InUseServerCooldown;
if (!IsValid(AbilitySystemComponent) || InCooldownTags.Num() < 1)
{
ListenForCooldownChange->EndTask();
return nullptr;
}
AbilitySystemComponent->OnActiveGameplayEffectAddedDelegateToSelf.AddUObject(ListenForCooldownChange, &URPGAsyncTaskCooldownChanged::OnActiveGameplayEffectAddedCallback);
TArray<FGameplayTag> CooldownTagArray;
InCooldownTags.GetGameplayTagArray(CooldownTagArray);
for (FGameplayTag CooldownTag : CooldownTagArray)
{
AbilitySystemComponent->RegisterGameplayTagEvent(CooldownTag, EGameplayTagEventType::NewOrRemoved).AddUObject(ListenForCooldownChange, &URPGAsyncTaskCooldownChanged::CooldownTagChanged);
}
return ListenForCooldownChange;
}
void URPGAsyncTaskCooldownChanged::EndTask()
{
if (IsValid(ASC))
{
ASC->OnActiveGameplayEffectAddedDelegateToSelf.RemoveAll(this);
TArray<FGameplayTag> CooldownTagArray;
CooldownTags.GetGameplayTagArray(CooldownTagArray);
for (FGameplayTag CooldownTag : CooldownTagArray)
{
ASC->RegisterGameplayTagEvent(CooldownTag, EGameplayTagEventType::NewOrRemoved).RemoveAll(this);
}
}
SetReadyToDestroy();
MarkPendingKill();
}
void URPGAsyncTaskCooldownChanged::OnActiveGameplayEffectAddedCallback(UAbilitySystemComponent* Target, const FGameplayEffectSpec& SpecApplied, FActiveGameplayEffectHandle ActiveHandle)
{
FGameplayTagContainer AssetTags;
SpecApplied.GetAllAssetTags(AssetTags);
FGameplayTagContainer GrantedTags;
SpecApplied.GetAllGrantedTags(GrantedTags);
TArray<FGameplayTag> CooldownTagArray;
CooldownTags.GetGameplayTagArray(CooldownTagArray);
for (FGameplayTag CooldownTag : CooldownTagArray)
{
if (AssetTags.HasTagExact(CooldownTag) || GrantedTags.HasTagExact(CooldownTag))
{
float TimeRemaining = 0.0f;
float Duration = 0.0f;
// Expecting cooldown tag to always be first tag
FGameplayTagContainer CooldownTagContainer(GrantedTags.GetByIndex(0));
GetCooldownRemainingForTag(CooldownTagContainer, TimeRemaining, Duration);
if (ASC->GetOwnerRole() == ROLE_Authority)
{
// Player is Server
OnCooldownBegin.Broadcast(CooldownTag, TimeRemaining, Duration);
}
else if (!UseServerCooldown && SpecApplied.GetContext().GetAbilityInstance_NotReplicated())
{
// Client using predicted cooldown
OnCooldownBegin.Broadcast(CooldownTag, TimeRemaining, Duration);
}
else if (UseServerCooldown && SpecApplied.GetContext().GetAbilityInstance_NotReplicated() == nullptr)
{
// Client using Server's cooldown. This is Server's corrective cooldown GE.
OnCooldownBegin.Broadcast(CooldownTag, TimeRemaining, Duration);
}
else if (UseServerCooldown && SpecApplied.GetContext().GetAbilityInstance_NotReplicated())
{
// Client using Server's cooldown but this is predicted cooldown GE.
// This can be useful to gray out abilities until Server's cooldown comes in.
OnCooldownBegin.Broadcast(CooldownTag, -1.0f, -1.0f);
}
}
}
}
void URPGAsyncTaskCooldownChanged::CooldownTagChanged(const FGameplayTag CooldownTag, int32 NewCount)
{
if (NewCount == 0)
{
OnCooldownEnd.Broadcast(CooldownTag, -1.0f, -1.0f);
}
}
bool URPGAsyncTaskCooldownChanged::GetCooldownRemainingForTag(FGameplayTagContainer InCooldownTags, float& TimeRemaining, float& CooldownDuration)
{
if (IsValid(ASC) && InCooldownTags.Num() > 0)
{
TimeRemaining = 0.f;
CooldownDuration = 0.f;
FGameplayEffectQuery const Query = FGameplayEffectQuery::MakeQuery_MatchAnyOwningTags(InCooldownTags);
TArray< TPair<float, float> > DurationAndTimeRemaining = ASC->GetActiveEffectsTimeRemainingAndDuration(Query);
if (DurationAndTimeRemaining.Num() > 0)
{
int32 BestIdx = 0;
float LongestTime = DurationAndTimeRemaining[0].Key;
for (int32 Idx = 1; Idx < DurationAndTimeRemaining.Num(); ++Idx)
{
if (DurationAndTimeRemaining[Idx].Key > LongestTime)
{
LongestTime = DurationAndTimeRemaining[Idx].Key;
BestIdx = Idx;
}
}
TimeRemaining = DurationAndTimeRemaining[BestIdx].Key;
CooldownDuration = DurationAndTimeRemaining[BestIdx].Value;
return true;
}
}
return false;
}
| [
"gordon.lobins@gmail.com"
] | gordon.lobins@gmail.com |
a313a0740d7719a3da9d525cf80062527907d067 | 539a0279d13915a13d2349976b4e4c101003deff | /src/Engine/PieceTypes/TenjikuShogi/BishopGeneral.cpp | f857fecb463628f7f5a89e7600670600a79443fb | [
"BSD-3-Clause"
] | permissive | jweathers777/mShogi | 5b74171eef748cfe3b4e2c651bbfe8f53fb9270d | 941cd4dc37e6e6210d4f993c96a553753e228b19 | refs/heads/master | 2021-01-01T20:35:02.538698 | 2018-03-03T22:35:29 | 2018-03-03T22:35:29 | 2,715,818 | 6 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,895 | cpp | ////////////////////////////////////////////////////////////////////////////
// Name: BishopGeneral.cpp
// Description: Interface for class that represents a bishop general
// Created: 08/31/2004 06:15:28 Eastern Standard Time
// Last Updated: $Date: 2004/09/18 22:23:06 $
// Revision: $Revision: 1.1 $
// Author: John Weathers
// Email: hotanguish@hotmail.com
// Copyright: (c) 2004 John Weathers
////////////////////////////////////////////////////////////////////////////
// mShogi header files
#include "BishopGeneral.hpp"
#include "Piece.hpp"
#include "Move.hpp"
#include "Board.hpp"
using std::vector;
using std::map;
using std::make_pair;
using std::string;
//--------------------------------------------------------------------------
// Class: BishopGeneral
// Method: BishopGeneral
// Description: Constructs an instance of a bishop general
//--------------------------------------------------------------------------
BishopGeneral::BishopGeneral(Board* board, int value, int typevalue, int rank,
map<int,int>* rankmap)
{
mpBoard = board;
mValue = value;
mTypeValue = typevalue;
mSize = mpBoard->GetSize();
mRank = rank;
mpRankMap = rankmap;
mpRankMap->insert(make_pair(typevalue, rank));
mNotation = "BGn";
mNames[0] = "Bishop General"; mNames[1] = "Kakusho";
mDescription =
"Moves any number of squares diagonally, jumping any pieces of lesser rank to make a capture";
// Set the size of the directions vector
mDirections.resize(DIRECTION_COUNT);
// Set up the directional method pointers
mDirections[NORTHWEST] = &Board::NorthWest;
mDirections[NORTHEAST] = &Board::NorthEast;
mDirections[SOUTHWEST] = &Board::SouthWest;
mDirections[SOUTHEAST] = &Board::SouthEast;
// Initialize the attack patterns
InitAttackPatterns();
}
| [
"johnweathers@gmail.com"
] | johnweathers@gmail.com |
52b3934949f6623f3866c2ccb4eb5c0d78dcc73d | 3caeef3d57a08cccbda4a396a16c66b493e45c8e | /aieBootstrap-master/LuaSoccerTutorial/BaseLuaObject.h | d7dcbce5e3acea0bfcfae8fd90c95c955a28c680 | [
"MIT"
] | permissive | HoHoHoson/AIE_2019_Yr2Programming | 9e73aad516c1d4cd54ad79b3e03a5b0a35465f7c | 8e216b7b3fa2217faca0f52215da67514f162dcf | refs/heads/master | 2020-04-18T21:49:33.350474 | 2019-12-02T10:46:17 | 2019-12-02T10:46:17 | 167,776,355 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,034 | h | #pragma once
#include <lua.hpp>
class BaseLuaObject
{
public:
/*
Constructor creates the Lua state and loads the default Lua libraries.
Each BaseLuaObject will have its own Lua environment.
*/
BaseLuaObject();
~BaseLuaObject();
/*
@brief Loads in a Lua script from a provided file path and calls its start function
@param File path to the script
@return True if the script was loaded and initialised, else False
*/
bool loadScript(const char* szPath);
/*
@brief Binds a C++ function to so that it can be called by the Lua script
@param A name that is assigned to the function binded to the script
@param The C++ function
*/
void registerLuaFunction(const char* szFuncName, lua_CFunction fcnFunction);
/*
@brief Calls a function that was added to the Lua stack
@param How many function arguements that were added to the stack
@param How many results from the function to place onto the Lua stack
@return True if it was successful, else False
*/
bool callFunction(int argCount, int returnCount);
/*
@brief Passes a pointer containing C++ data to the Lua script
@param Pointer to the Lua state
@param Global name assigned to the pointer
@param Pointer to a C++ variable
*/
static void setPointerVar(lua_State* pState, const char* pVarName, void* vpVal);
/*
@brief Retrieves a pointer from the Lua script
@param Pointer to the Lua state
@param Global name that was assigned to the pointer
@return The variable pointer address
*/
static void* getPointerVar(lua_State* pState, const char* pVarName);
/*
@brief Pushes a float variable from the C++ script to the Lua stack to be used
@param Float value
*/
void pushFloat(float fvalue);
/*
@brief Pops a float variable off the Lua stack
@return Float value that was popped off the Lua stack
*/
float popFloat();
/*
@brief Pushes onto the Lua stack the value of the global name
@param Global name of the function
*/
void pushFunction(const char* szFunction);
private:
lua_State* m_pLua_state;
}; | [
"hoson_zhong@hotmail.com"
] | hoson_zhong@hotmail.com |
deeb24c8473c54388cab341e6e0c287ae8621c9c | d5120112a7ec8244d1ed5c1a1c9dcf3762fc7acb | /util/fraction.h | 6a61a9a3738feaf94253675a799d926b9413e291 | [] | no_license | Mr-Smithy-x/Fraction | 9816a467ead8f3cb50bf47e402d8f7acc6316d78 | d5bd32bfffaca32fdc4ffbbcb6246ba6835186c8 | refs/heads/master | 2021-06-25T01:26:56.442109 | 2017-04-26T04:35:05 | 2017-04-26T04:35:05 | 59,630,639 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,231 | h | //
// Created by Charlton on 5/19/16.
//
#ifndef FRACTION_H
#define FRACTION_H
#include <iostream>
class fraction {
int denom;
int num;
public:
fraction(int num, int denom);
fraction(int num);
fraction();
int getNumerator() const;
int getDenominator() const;
double convert() const;
bool canReduce();
void reduce();
friend std::ostream &operator<<(std::ostream &os, const fraction &f) {
if (f.getDenominator() == 0) return os << "undefined";
else if (f.getDenominator() == 1) return os << f.getNumerator();
else return os << f.getNumerator() << '/' << f.getDenominator();
}
friend std::istream &operator>>(std::istream &in, fraction &f) {
std::string s;
in >> s;
unsigned long index = s.find('/', 0);
if (index != -1) {
f.num = stoi(s.substr(0, index));
f.denom = stoi(s.substr(index + 1, s.length()));
} else {
f.num = stoi(s);
}
return in;
}
fraction operator*(const int &integer);
fraction operator*=(const int &integer);
fraction operator/(const int &integer);
fraction operator/=(const int &integer);
fraction operator+(const int &integer);
fraction operator-(const int &integer);
fraction operator+=(const int &integer);
fraction operator-=(const int &integer);
fraction operator*(const fraction &f);
fraction operator*=(const fraction &f);
fraction operator/(const fraction &f);
fraction operator/=(const fraction &f);
fraction operator+(const fraction &f);
fraction operator-(const fraction &f);
fraction operator+=(const fraction &f);
fraction operator-=(const fraction &f);
bool operator<(const fraction &f);
bool operator==(const fraction &f);
bool operator<=(const fraction &f);
bool operator>(const fraction &f);
bool operator>=(const fraction &f);
bool operator!=(const fraction &f);
private:
bool hasSameBase(int denom, int denom2);
bool isFactor(int n1, int n2);
bool getLCD(int denom, int denom2, int *m1, int *m2);
int multiplyBy(int n1, int n2);
int getGCD(int num, int denom);
int getGCD();
};
#endif //FRACTION_H
| [
"CharltonSmith@outlook.com"
] | CharltonSmith@outlook.com |
6c212860c9f453e8620fd7f0d560558da21a7e57 | 7bae26d82184942b05f884ac23af9deae004a98d | /core/src/main.cpp | fe45ea64ec6a771806999b7814aec8928a554e24 | [] | no_license | JohannesTimmreck/tek2_arcade | 9d56e89c13068c463f1da3199cfdc4bbe3a356a0 | ffc61cf89d2563b2ab2e4aeeb0ec4c5d05cccd36 | refs/heads/main | 2023-02-27T08:56:18.743515 | 2021-02-08T10:35:53 | 2021-02-08T10:35:53 | 337,014,291 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 407 | cpp | /*
** EPITECH PROJECT, 2019
** OOP_arcade_2019
** File description:
** description
*/
#include <iostream>
#include "../include/Core.hpp"
int main(int ac, char **av)
{
if (ac != 2) {
std::cerr << "Usage: ./arcade ./[path to graphical shared library module]" << std::endl;
return 84;
}
core::Core core(av[1]);
if (!core.graphicsLoaded())
return 84;
core.loop();
} | [
"johannes.timmrec@epitech.eu"
] | johannes.timmrec@epitech.eu |
22b650160bad5887a3a43163e22fc13df6e7ab0f | 31f5cddb9885fc03b5c05fba5f9727b2f775cf47 | /thirdparty/mlpack/methods/emst/dtb_stat.hpp | 020a953a80ed48e0e8b3d238ad7fbda917a989eb | [
"MIT"
] | permissive | timi-liuliang/echo | 2935a34b80b598eeb2c2039d686a15d42907d6f7 | d6e40d83c86431a819c6ef4ebb0f930c1b4d0f24 | refs/heads/master | 2023-08-17T05:35:08.104918 | 2023-08-11T18:10:35 | 2023-08-11T18:10:35 | 124,620,874 | 822 | 102 | MIT | 2021-06-11T14:29:03 | 2018-03-10T04:07:35 | C++ | UTF-8 | C++ | false | false | 3,143 | hpp | /**
* @file dtb.hpp
* @author Bill March (march@gatech.edu)
*
* DTBStat is the StatisticType used by trees when performing EMST.
*
* mlpack is free software; you may redistribute it and/or modify it under the
* terms of the 3-clause BSD license. You should have received a copy of the
* 3-clause BSD license along with mlpack. If not, see
* http://www.opensource.org/licenses/BSD-3-Clause for more information.
*/
#ifndef MLPACK_METHODS_EMST_DTB_STAT_HPP
#define MLPACK_METHODS_EMST_DTB_STAT_HPP
#include <mlpack/prereqs.hpp>
namespace mlpack {
namespace emst {
/**
* A statistic for use with mlpack trees, which stores the upper bound on
* distance to nearest neighbors and the component which this node belongs to.
*/
class DTBStat
{
private:
//! Upper bound on the distance to the nearest neighbor of any point in this
//! node.
double maxNeighborDistance;
//! Lower bound on the distance to the nearest neighbor of any point in this
//! node.
double minNeighborDistance;
//! Total bound for pruning.
double bound;
//! The index of the component that all points in this node belong to. This
//! is the same index returned by UnionFind for all points in this node. If
//! points in this node are in different components, this value will be
//! negative.
int componentMembership;
public:
/**
* A generic initializer. Sets the maximum neighbor distance to its default,
* and the component membership to -1 (no component).
*/
DTBStat() :
maxNeighborDistance(DBL_MAX),
minNeighborDistance(DBL_MAX),
bound(DBL_MAX),
componentMembership(-1) { }
/**
* This is called when a node is finished initializing. We set the maximum
* neighbor distance to its default, and if possible, we set the component
* membership of the node (if it has only one point and no children).
*
* @param node Node that has been finished.
*/
template<typename TreeType>
DTBStat(const TreeType& node) :
maxNeighborDistance(DBL_MAX),
minNeighborDistance(DBL_MAX),
bound(DBL_MAX),
componentMembership(
((node.NumPoints() == 1) && (node.NumChildren() == 0)) ?
node.Point(0) : -1) { }
//! Get the maximum neighbor distance.
double MaxNeighborDistance() const { return maxNeighborDistance; }
//! Modify the maximum neighbor distance.
double& MaxNeighborDistance() { return maxNeighborDistance; }
//! Get the minimum neighbor distance.
double MinNeighborDistance() const { return minNeighborDistance; }
//! Modify the minimum neighbor distance.
double& MinNeighborDistance() { return minNeighborDistance; }
//! Get the total bound for pruning.
double Bound() const { return bound; }
//! Modify the total bound for pruning.
double& Bound() { return bound; }
//! Get the component membership of this node.
int ComponentMembership() const { return componentMembership; }
//! Modify the component membership of this node.
int& ComponentMembership() { return componentMembership; }
}; // class DTBStat
} // namespace emst
} // namespace mlpack
#endif // MLPACK_METHODS_EMST_DTB_STAT_HPP
| [
"qq79402005@gmail.com"
] | qq79402005@gmail.com |
52c2c8ac38fc09075bb2b2b3fd13edf0603095b7 | c95f3bc5467817331c43e140e8f93d4a8cc53cdb | /akbar.cpp | d51440da6143b7ab0a9f9b9223f0ae85510a720f | [] | no_license | ashutosh61973/graph-algos | 354b89bbf7d270f039044a781599a337369e77bc | 35c0207b243bf1f8a27bdb1d56b6d262189b3b85 | refs/heads/main | 2023-03-27T05:59:00.857219 | 2021-03-19T19:31:01 | 2021-03-19T19:31:01 | 329,944,023 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,403 | cpp | #include "bits/stdc++.h"
using namespace std;
#define inti long long
#define ll long long
const long long INF = 1e18;
const int32_t M = 1e9 + 7;
const int32_t mod = 1e9 + 7;
const int32_t MM = 998244353;
void multisourcesbfs(vector<vector<int>> &graph, vector<int> &visited, vector<int> &protect, vector<pair<int, int>> &nodes_in_muti_bfs, int n)
{
queue<pair<int, int>> q;
for (auto x : nodes_in_muti_bfs)
{
q.push(x);
visited[x.first] = 1;
}
while (!q.empty())
{
auto t = q.front();
q.pop();
int node = t.first;
int st = t.second;
for (auto x : graph[node])
{
if ((st >= 1) and !visited[x])
{
visited[x] = 1;
q.push({x, st - 1});
protect[x] = 1;
}
}
}
}
void optimum(vector<vector<int>> &graph, int n, vector<int> &strength)
{
vector<pair<int, int>> nodes_in_muti_bfs;
vector<int> protect(n + 1, 0);
vector<int> visited(n + 1, 0);
for (int i = 1; i <= n; i++)
{
if (strength[i] != -1)
{
nodes_in_muti_bfs.push_back({i, strength[i]});
protect[i] = 1;
}
}
multisourcesbfs(graph, visited, protect, nodes_in_muti_bfs, n);
int f = 1;
for (int i = 1; i <= n; i++)
{
if (protect[i] == 0)
{
f = 0;
break;
}
}
if (f == 1)
{
cout << "Yes" << endl;
}
else
{
cout << "No" << endl;
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
// memset(prime, true, sizeof(prime));
//primes(); // primes under 1lakh
/*
#ifdef NCR
init();
#endif
*/
int t;
cin >> t;
while (t--)
{
int n, r, m;
cin >> n >> r >> m;
vector<vector<int>> graph(n + 1);
for (int i = 0; i < r; i++)
{
int a, b;
cin >> a >> b;
graph[a].push_back(b);
graph[b].push_back(a);
}
vector<int> strength(n + 1, -1);
for (int i = 0; i < m; i++)
{
int node, s;
cin >> node >> s;
strength[node] = s;
}
optimum(graph, n, strength);
}
}
| [
"noreply@github.com"
] | noreply@github.com |
8e701073e66407c8fb4aa2e1fa391f94d82b589c | 1ce44fbfada941ace76074d459dc3a367b201dd5 | /alignment.hpp | 015fc26a89c5184b67b61657cfddb8691583e9ba | [] | no_license | cwpearson/unified-memory-microbench | 6b6eec63b8ff13f36927e8b4890265c3bf8f9f08 | 671bae4fa645239b9774c51676ac3e729d67d2b5 | refs/heads/master | 2020-05-30T22:29:25.205390 | 2019-06-11T22:43:10 | 2019-06-11T22:43:10 | 189,994,416 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 337 | hpp | #pragma once
#include <cstdint>
inline size_t alignment_of(void *ptr) {
for (size_t i = 2; i <= 512; i *= 2) {
if ((uintptr_t(ptr) % i) != 0) {
return i/2;
}
}
return 512;
}
template <typename T>
T* align(T *ptr, size_t align) {
uintptr_t u = uintptr_t(ptr);
while (u % align != 0) {u++;}
return (T*)u;
}
| [
"pearson@illinois.edu"
] | pearson@illinois.edu |
14cb0e80cb285ef3f3e56aa7cb28b1263e93cfb8 | dc262d6d73e9415db2ba7bedc1c066de75af3e69 | /wcIncludes/NotConverted/wcProGraphic.h | 3a2cc6a123fcfb0b41c02fac1e9c82e2eeea932a | [] | no_license | talmaoz28/wcInclude | 0724387b0f1061e000ca23048f5dbc6c10fdc10f | 0f150e939e798e573ea9f4846d130f5c56f52e06 | refs/heads/master | 2020-05-18T19:49:56.220961 | 2019-05-02T16:50:45 | 2019-05-02T16:50:45 | 184,617,644 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,813 | h | /*-------------- C L A S S wcProGraphic --------
A Wrapper Class for ProE object: ProGraphic
Created By: Michael Lucatz
Date: 31/07/2007 15:58:51
Version: 2.0
---------------------------------------------------*/
#pragma once
#include "wcproobject.h"
#include <ProGraphic.h>
class wcProGraphic: public wcProObject
{
public:
wcProGraphic(void);
~wcProGraphic(void);
public:
// Draws an arc on the screen.
ProError GraphicsArcDraw ( ProPoint3d center,double radius,ProVector vector1,ProVector vector2 );
// Draws filled or unfilled polygons in the window.
ProError GraphicsPolygonDraw ( ProPoint2d* point_array,int num_points,ProColortype fill_color );
// Draws text on the screen.
ProError GraphicsTextDisplay ( ProPoint3d point,wchar_t* text );
// Changes the color used to draw any subsequent graphics.
ProError GraphicsColorSet ( ProColortype new_color,ProColortype *p_old_color );
// Changes the color used to draw any subsequent graphics.
ProError GraphicsColorModify ( ProColor* new_color,ProColor *p_old_color );
// Retrieves the current text attributes. If the current text attributes have
ProError TextAttributesCurrentGet (ProTextAttribute* attribute);
// Sets the font identifier of Pro/ENGINEER text output.
ProError TextFontIdCurrentSet ( int font_id );
// Sets the height of Pro/ENGINEER text output.
ProError TextHeightCurrentSet ( double height );
// Sets the width factor of Pro/ENGINEER text output.
ProError TextWidthFactorCurrentSet ( double width_factor );
// Sets the rotational angle of Pro/ENGINEER text output.
ProError TextRotationAngleCurrentSet ( double rotation_angle );
// Sets the slant angle of Pro/ENGINEER text output.
ProError TextSlantAngleCurrentSet( double slant_angle );
// Unsets the text attributes set using the function<b>ProText*CurrentSet()</b>. After unsetting the attributes,
ProError TextAttributesCurrentUnset ( void );
// Returns the identifier for the specified text font name.
ProError TextFontNameToId (ProLine font_name,int* font_id);
// Retrieves the font name for the specified font identifier.
ProError TextFontNameGet (int font_id,ProLine font_name);
// Sets the drawing mode.
ProError GraphicsModeSet ( ProDrawMode new_mode,ProDrawMode* old_mode );
// Reports the mouse position when the user presses one of the mouse
ProError MousePickGet ( ProMouseButton expected_button,ProMouseButton* button_pressed,ProPoint3d position );
// Reports the current mouse position immediately, regardless of
ProError MouseTrack ( int options,ProMouseButton* button_pressed,ProPoint3d position );
// Draws a dynamic rectangle from the specified point (in screen
ProError MouseBoxInput ( ProPoint3d point,ProOutline outline );
};
| [
"noreply@github.com"
] | noreply@github.com |
39c41fef8348f8ac9921099e9ad92ae080205f74 | b118951228f0a12e93ac7faa638be454ec72f868 | /codeforces/B/793B-Igor and his way to work.cpp | 220a8cc73a2110a7225584a2d88bafcdb1c05675 | [] | no_license | hpotter97762/CP | 372ef86ae34a1bb79d87df3192764eb716aae281 | ccc97a6eb13fba067012edc02aebf7e0fffb0005 | refs/heads/master | 2020-03-27T03:54:28.637113 | 2019-09-23T11:53:11 | 2019-09-23T11:53:11 | 145,897,937 | 0 | 0 | null | 2019-09-23T11:53:55 | 2018-08-23T19:26:10 | C++ | UTF-8 | C++ | false | false | 3,253 | cpp | #include<bits/stdc++.h>
#define fs first
#define sc second
#define pi 3.141592653589793238462643383279502884197
//#define e 2.7182818284590452353602874713526624977572
typedef long long int ll;
typedef long double ld;
typedef std::vector<ll> vi;
typedef std::vector<bool> vb;
typedef std::vector<char> vc;
typedef std::pair<ll,ll> pii;
typedef std::vector<pii> vii;
using namespace std;
const ll mod=1e9+7;
int main(){
std::ios_base::sync_with_stdio(0);
cin.tie(0);
ll n,m;
cin>>n>>m;
vector<vc>a(n,vc(m));
pii s,t;
for(ll i=0;i<n;++i)
for(ll j=0;j<m;++j){
cin>>a[i][j];
if(a[i][j]=='S')
s={i,j};
if(a[i][j]=='T')
t={i,j};
}
// for(int i=0;i<n;++i){
// for(int j=0;j<m;++j)
// cout<<a[i][j]<<' ';
// cout<<'\n';
// }
// cout<<s.fs<<' '<<s.sc<<' '<<t.fs<<' '<<t.sc<<'\n';
ll mn,mx;
for(ll i=s.fs;;++i){
if(i==n||a[i][s.sc]=='*'){
mx=i-1;
// cout<<mx<<'\n';
break;
}
}
for(ll i=t.fs;;++i){
if(i==n||a[i][t.sc]=='*'){
mx=min(mx,i-1);
// cout<<mx<'\n';
break;
}
}
for(ll i=s.fs;;--i){
if(i==-1||a[i][s.sc]=='*'){
mn=i+1;
// cout<<mn<<'\n';
break;
}
}
for(ll i=t.fs;;--i){
if(i==-1||a[i][t.sc]=='*'){
mn=max(mn,i+1);
// cout<<mn<<'\n';
break;
}
}
std::vector<vi> v(n,vi(m));
for(ll i=0;i<n;++i)
v[i][0]=0;
for(ll i=0;i<n;++i){
for(ll j=1;j<m;++j){
v[i][j]=(a[i][j-1]=='*')?j:v[i][j-1];
}
}
ll tp=max(s.sc,t.sc),tmp=min(s.sc,t.sc);
for(ll i=mn;i<=mx;++i){
if(v[i][tp]<=tmp){
cout<<"YES\n";
return 0;
}
}
// for(int i=0;i<n;++i){
// for(int j=0;j<m;++j)
// cout<<v[i][j]<<' ';
// cout<<'\n';
// }
for(ll i=s.sc;;++i){
if(i==m||a[s.fs][i]=='*'){
mx=i-1;
break;
}
}
// cout<<mx<<'\n';
for(ll i=t.sc;;++i){
if(i==m||a[t.fs][i]=='*'){
mx=min(mx,i-1);
break;
}
}
// cout<<mx<<'\n';
for(ll i=s.sc;;--i){
if(i==-1||a[s.fs][i]=='*'){
mn=i+1;
break;
}
}
// cout<<mn<<'\n';
for(ll i=t.sc;;--i){
if(i==-1||a[t.fs][i]=='*'){
mn=max(mn,i+1);
break;
}
}
// cout<<mn<<'\n';
for(ll i=0;i<m;++i)
v[0][i]=0;
for(ll i=1;i<n;++i){
for(ll j=0;j<m;++j){
v[i][j]=(a[i-1][j]=='*')?i:v[i-1][j];
}
}
// cout<<mn<<' '<<mx<<'\n';
tp=max(s.fs,t.fs),tmp=min(s.fs,t.fs);
for(ll i=mn;i<=mx;++i){
if(v[tp][i]<=tmp){
cout<<"YES\n";
return 0;
}
}
// for(int i=0;i<n;++i){
// for(int j=0;j<m;++j)
// cout<<v[i][j]<<' ';
// cout<<'\n';
// }
cout<<"NO\n";
return 0;
} | [
"hpotter97762@gmail.com"
] | hpotter97762@gmail.com |
23e27aa13166709385a09a7c5893d81ac86c2e3e | d80556050142e45aa26e353544422f2dfbc0dffb | /leetcode-com/283_Move_Zeroes.cpp | 2113a77bd21d38ab3b4a25530735c32f26b6e8b2 | [] | no_license | Alexzsh/oj | c68822fcb9e70c6a791a87c74f4034bb50148354 | 48625a3ee463ae9de253b6a19bcc2b1f249c1f2e | refs/heads/master | 2021-07-06T06:39:04.956354 | 2019-04-27T10:51:39 | 2019-04-27T10:51:39 | 141,728,785 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 654 | cpp | #include<iostream>
#include<vector>
using namespace std;
void moveZeroes(vector<int>& nums) {
vector<int> tmp;
for(vector<int>::iterator it = nums.begin();it!=nums.end();it++){
if(*it==0){
tmp.push_back(*it);
it=nums.erase(it);
}
}
for(vector<int>::iterator it = tmp.begin();it!=tmp.end();it++){
nums.push_back(*it);
}
}
int main(){
vector<int> vec;
vec.push_back(100);
vec.push_back(0);
vec.push_back(300);
vec.push_back(300);
vec.push_back(300);
vec.push_back(0);
moveZeroes(vec);
for(vector<int>::iterator it=vec.begin();it!=vec.end();it++)
cout<<*it<<" ";
}
| [
"zjutzsh@gmail.com"
] | zjutzsh@gmail.com |
8cd259919da672a1bb621c9bfc5d0d984b35ff17 | 29b4191ca3796933b16b42c5a5c64905cb24bd43 | /FTP_CLIENT/download.cpp | 8b635c97342faed1a37a1984f19b5a7677d21787 | [] | no_license | iamcarp/QT-FTP-CLIENT | e72c74f4c2c54849157d7f77aa19bb891b01bce7 | a2844798321af6ef3fafd143e7500b84b8cbf27f | refs/heads/master | 2020-12-13T14:17:57.798053 | 2020-01-19T22:26:17 | 2020-01-19T22:26:17 | 234,442,611 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,279 | cpp | #include "mainwindow.h"
void MainWindow::readContent()
{
file->write(reply->readAll());
}
/****************************************************************************************/
/****************************************************************************************/
/****************************************************************************************/
void MainWindow::on_Btn_download_clicked()
{
if (initFTP())
{
QString folderPath;
folderPath = QFileDialog::getExistingDirectory(this, tr("Select the file"), "../FTP_CLIENT/CLIENT_FILES/RECEIVE", QFileDialog::ShowDirsOnly);
if (!folderPath.isEmpty())
{
file = new QFile(folderPath + "/music.mp3");
file->open(QIODevice::WriteOnly);
//preuzmi fajl sa servera u izabrani folder
QNetworkAccessManager *accessManager = new QNetworkAccessManager(this);
accessManager->setNetworkAccessible(QNetworkAccessManager::Accessible);
QString m_ftpPath;
m_ftpPath = ftpPath;
QUrl url(m_ftpPath+"/SEND/pesma.mp3");
url.setPort(21);
url.setUserName(user);
url.setPassword(password);
QNetworkRequest request(url);
reply = accessManager->get(request);
connect((QObject *)reply, SIGNAL(readyRead()), this, SLOT(readContent()));
connect(accessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
connect(reply, SIGNAL(downloadProgress(qint64 ,qint64)), this, SLOT(loadProgress(qint64 ,qint64)));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),SLOT(replyError(QNetworkReply::NetworkError)));
QMessageBox::information(NULL, tr(""), "DOWNLOAD IS DONE");
}
else
{
QMessageBox::critical(NULL, tr(""), "DOWNLOAD IS CANCELLED");
}
}
}
/****************************************************************************************/
/****************************************************************************************/
/****************************************************************************************/
void MainWindow::on_Btn_download_2_clicked()
{
if (initFTP()) {
QString folderPath;
folderPath = QFileDialog::getExistingDirectory(this, tr("Select the file"), "../FTP_CLIENT/CLIENT_FILES/RECEIVE", QFileDialog::ShowDirsOnly);
if (!folderPath.isEmpty())
{
file = new QFile(folderPath + "/text.txt");
file->open(QIODevice::WriteOnly);
//preuzmi fajl sa servera u izabrani folder
QNetworkAccessManager *accessManager = new QNetworkAccessManager(this);
accessManager->setNetworkAccessible(QNetworkAccessManager::Accessible);
QString m_ftpPath;
m_ftpPath = ftpPath+"/SEND/";
QUrl url(m_ftpPath+"test.txt");
url.setPort(21);
url.setUserName(user);
url.setPassword(password);
QNetworkRequest request(url);
reply = accessManager->get(request);
connect((QObject *)reply, SIGNAL(readyRead()), this, SLOT(readContent()));
connect(accessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
connect(reply, SIGNAL(downloadProgress(qint64 ,qint64)), this, SLOT(loadProgress(qint64 ,qint64)));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),SLOT(replyError(QNetworkReply::NetworkError)));
}
else
{
QMessageBox::critical(NULL, tr(""), "DOWNLOAD IS CANCELLED");
}
}
}
/****************************************************************************************/
/****************************************************************************************/
/****************************************************************************************/
void MainWindow::on_Btn_download_3_clicked()
{
if (initFTP())
{
QString folderPath;
folderPath = QFileDialog::getExistingDirectory(this, tr("Select the file"), "../FTP_CLIENT/CLIENT_FILES/RECEIVE", QFileDialog::ShowDirsOnly);
if (!folderPath.isEmpty())
{
file = new QFile(folderPath + "/slika.jpg");
file->open(QIODevice::WriteOnly);
//preuzmi fajl sa servera u izabrani folder
QNetworkAccessManager *accessManager = new QNetworkAccessManager(this);
accessManager->setNetworkAccessible(QNetworkAccessManager::Accessible);
QString m_ftpPath;
m_ftpPath = ftpPath;
QUrl url(m_ftpPath+"/SEND/SDL.jpg");
url.setPort(21);
url.setUserName(user);
url.setPassword(password);
QNetworkRequest request(url);
reply = accessManager->get(request);
connect((QObject *)reply, SIGNAL(readyRead()), this, SLOT(readContent()));
connect(accessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(replyFinished(QNetworkReply*)));
connect(reply, SIGNAL(downloadProgress(qint64 ,qint64)), this, SLOT(loadProgress(qint64 ,qint64)));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)),SLOT(replyError(QNetworkReply::NetworkError)));
QMessageBox::information(NULL, tr(""), "DOWNLOAD IS DONE");
}
else
{
QMessageBox::critical(NULL, tr(""), "DOWNLOAD IS CANCELLED");
}
}
}
| [
"lukakaran5@gmail.com"
] | lukakaran5@gmail.com |
487525da8d2852c545f997ec66e1c055d6c58b91 | dacba2d3675b21d16d97bd6c4b438498ec1810bd | /Source/TestingGroundsFPS/TestingGroundsFPSHUD.cpp | bea5e98de64a28bf60e492c667c1a8fd2fd0e37b | [] | no_license | JordanKaspers/UE4_05 | 170d7ce15f698f8cc8198508ad4df74785b55fe0 | 86206d9761191143d3eb6e392eb00823fe12f87e | refs/heads/master | 2020-03-09T01:35:55.761573 | 2018-04-26T12:35:39 | 2018-04-26T12:35:39 | 128,519,019 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,090 | cpp | // Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "TestingGroundsFPSHUD.h"
#include "Engine/Canvas.h"
#include "Engine/Texture2D.h"
#include "TextureResource.h"
#include "CanvasItem.h"
#include "UObject/ConstructorHelpers.h"
ATestingGroundsFPSHUD::ATestingGroundsFPSHUD()
{
// Set the crosshair texture
static ConstructorHelpers::FObjectFinder<UTexture2D> CrosshairTexObj(TEXT("/Game/Static/Player/Textures/FirstPersonCrosshair"));
CrosshairTex = CrosshairTexObj.Object;
}
void ATestingGroundsFPSHUD::DrawHUD()
{
Super::DrawHUD();
// Draw very simple crosshair
// find center of the Canvas
const FVector2D Center(Canvas->ClipX * 0.5f, Canvas->ClipY * 0.5f);
// offset by half the texture's dimensions so that the center of the texture aligns with the center of the Canvas
const FVector2D CrosshairDrawPosition( (Center.X),
(Center.Y + 20.0f));
// draw the crosshair
FCanvasTileItem TileItem( CrosshairDrawPosition, CrosshairTex->Resource, FLinearColor::White);
TileItem.BlendMode = SE_BLEND_Translucent;
Canvas->DrawItem( TileItem );
}
| [
"kaspers@esat-alumni.com"
] | kaspers@esat-alumni.com |
c7ec696baf796ea473da2369a114ca186b16cb63 | 3ad968797a01a4e4b9a87e2200eeb3fb47bf269a | /MFC CodeGuru/misc/realtime_plot/Project/clPlot/demo/demoDoc.h | 92e3dd536abf9a2aba60e3e586946ada04777001 | [] | no_license | LittleDrogon/MFC-Examples | 403641a1ae9b90e67fe242da3af6d9285698f10b | 1d8b5d19033409cd89da3aba3ec1695802c89a7a | refs/heads/main | 2023-03-20T22:53:02.590825 | 2020-12-31T09:56:37 | 2020-12-31T09:56:37 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,404 | h | // demoDoc.h : interface of the CDemoDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_DEMODOC_H__BB27870D_A140_11D1_BEB4_006008918F1C__INCLUDED_)
#define AFX_DEMODOC_H__BB27870D_A140_11D1_BEB4_006008918F1C__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
class CDemoDoc : public CDocument
{
protected: // create from serialization only
CDemoDoc();
DECLARE_DYNCREATE(CDemoDoc)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDemoDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CDemoDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CDemoDoc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DEMODOC_H__BB27870D_A140_11D1_BEB4_006008918F1C__INCLUDED_)
| [
"pkedpekr@gmail.com"
] | pkedpekr@gmail.com |
31669c7bcdc69a0cc424f569d3e4e04baa8d6579 | 6a7321f37b00f22aa554273228fb0f09d48248d8 | /quincySystemLibrary/dev/src/thread/Mutex.hpp | ac8d7aa36204acef7175c7a6ee8925541e5d2605 | [
"MIT"
] | permissive | quincycs/CollegeProjects | 9bd16184a23dbcb73243b15685db47d568eac263 | ff1634af0399e3cefaa0f6dcbc60acff4522f016 | refs/heads/master | 2021-08-31T00:34:15.223453 | 2017-12-20T01:08:05 | 2017-12-20T01:08:05 | 114,825,560 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,964 | hpp | /*
* Mutex.hpp
*
* Created on: Jul 8, 2010
* Author: quincy
*/
#ifndef MUTEX_HPP_
#define MUTEX_HPP_
#include "posix/MutexImp.hpp" // USE_POSIX_THREADS
namespace quincySystemLibrary {
/// classic mutex which only locks/unlocks a thread from context switching with other threads executing the same execution code.
class Mutex : private MutexImp{
public:
///creates mutex into unlocked state
Mutex(){}
virtual ~Mutex(){}
///set the start of a critical section for this thread.
void lock(){MutexImp::lock();}
///set end of critical section for this thread. (Careful: thread B can not unlock thread A's critical section. You should only call unlock on the same thread and mutex as you did for lock).
void unlock(){MutexImp::unlock();}
};
/**
* When a ScopeLock is out of scope then it will be unlocked and not destroyed.
*
* Here is a common situation: Using a mutex and there are many points of failure/points of function returning in method and the mutex needs to be unlocked after those points.
* Instead of the solution of the following...
Mutex mtx; is a private class variable:
mtx.lock();
try{
// some code that needs to be in a critical section
// many points of failure/points of function returning/exceptions thrown.
}
catch (...){
mtx.unlock();
throw;
}
mtx.unlock();
*
* Do this instead:
* {
* ScopeLock lock(mtx);
* // some code that needs to be in a critical section
* // many points of failure/points of function returning/exceptions thrown.
* // if any of this critical section returns or fails, the ScopeLock will go out of scope and unlock.
* }
* //lock is out of scope now, so that means the mutex is unlocked.
*/
/// lock a mutex only when ScopedLock stays in scope.
class ScopedLock {
private:
Mutex &_mutex;
public:
///locks mutex
ScopedLock(Mutex &mutex):_mutex(mutex){mutex.lock();}
///unlocks mutex
~ScopedLock(){_mutex.unlock();}
};
}
#endif /* MUTEX_HPP_ */
| [
"qmitchell@claritycon.com"
] | qmitchell@claritycon.com |
0a9fdaebfbbdae0092a3af0caa74f799c0d45be9 | c45ed46065d8b78dac0dd7df1c95b944f34d1033 | /TC-SRM-592-div1-300/ywq.cpp | 3c6bcaaed6254e42b0aa6e99b31db9002db4ec3f | [] | no_license | yzq986/cntt2016-hw1 | ed65a6b7ad3dfe86a4ff01df05b8fc4b7329685e | 12e799467888a0b3c99ae117cce84e8842d92337 | refs/heads/master | 2021-01-17T11:27:32.270012 | 2017-01-26T03:23:22 | 2017-01-26T03:23:22 | 84,036,200 | 0 | 0 | null | 2017-03-06T06:04:12 | 2017-03-06T06:04:12 | null | UTF-8 | C++ | false | false | 654 | cpp | #include <map>
#include <cmath>
#include <cstdio>
#include <string>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define pb push_back
#define mp make_pair
#define x first
#define y second
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
struct LittleElephantAndBalls
{
int getNumber(string s)
{
int N=s.size(),ans=0;
int s1=0,s2=0,s3=0;
for (int i=0;i<N;i++)
{
ans+=min(s1,2)+min(s2,2)+min(s3,2);
if (s[i]=='R') s1++;
if (s[i]=='G') s2++;
if (s[i]=='B') s3++;
}
return ans;
}
};
| [
"noreply@github.com"
] | noreply@github.com |
918f6d305b8b69bf74e88458dcd8f7e9bab6d860 | 9b1e0c88bc35c56969e191c4683151a3560c2cfd | /projects/IAssaultCube/src/Layer/Menu.h | 8207cbf0469aaa0d7893e6e66593c83f0b65e3b5 | [] | no_license | zanzo420/gamehacks | f88148696e1a50630b54427cee648f85795ba545 | 741d2e337537d5b1b1cf389e927dd5a7b890145f | refs/heads/master | 2022-03-27T13:20:34.658262 | 2020-01-03T17:45:26 | 2020-01-03T17:45:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 968 | h | #pragma once
#include "pch.h"
#include "Icetrix/Application.h"
#include "Icetrix/Layer.h"
#include "Icetrix/Platform/OpenGL/OpenGL.h"
#include "BlackBone/LocalHook/LocalHook.hpp"
#include "Game/Game.h"
#include "SDL.h"
namespace App
{
class Menu
{
private:
Icetrix::Application& app;
public:
Menu() : app(Icetrix::Application::GetInstance())
{
app.dispatcher.sink<Icetrix::LayerEvent::Attach>().connect<&Menu::Create>(*this);
app.dispatcher.sink<Icetrix::LayerEvent::Shutdown>().connect<&Menu::Shutdown>(*this);
app.dispatcher.sink<Icetrix::Hook::WglSwapBufferEvent::Initialize>().connect<&Menu::Init>(*this);
app.dispatcher.sink<Icetrix::Hook::WglSwapBufferEvent::Update>().connect<&Menu::Render>(*this);
app.dispatcher.sink<Icetrix::Hook::PollEvent::Update>().connect<&Menu::PollEvent>(*this);
}
void Create();
void Init();
void Render();
void PollEvent(const Icetrix::Hook::PollEvent::Update &update);
void Shutdown();
};
}
| [
"stevenklar0@gmail.com"
] | stevenklar0@gmail.com |
c3972b51c81f128a3c5110751ec95da7a4a5f488 | 0913de19b69ed7cc90e54b827af2204e2eb705fe | /algo_plugin/algo_plugin/algo_plugin.cpp | c3a494cac1250b3d2c64689591656b6b926b99b9 | [] | no_license | BlueyeInformation/algo-plug | bde5dd0abd6c6ebc7b7b71abad1d1e5e6e4e8825 | 2842688e1f42dd50a228185c48f48c58d2c94418 | refs/heads/master | 2023-01-25T02:16:35.076502 | 2020-12-09T12:24:29 | 2020-12-09T12:24:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,047 | cpp | // algo_plugin.cpp :
//
#include "stdafx.h"
#include "algo_plugin.h"
#include "Algorithms.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
using namespace std;
// Calgo_pluginApp
BEGIN_MESSAGE_MAP(Calgo_pluginApp, CWinApp)
END_MESSAGE_MAP()
Calgo_pluginApp::Calgo_pluginApp()
{
// TODO:
}
Calgo_pluginApp theApp;
// Calgo_pluginApp Initialization
BOOL Calgo_pluginApp::InitInstance()
{
CWinApp::InitInstance();
return TRUE;
}
std::map<std::string, tag_FUNC_LIST> g_map_functions;
bool dynamic_init()
{
tag_FUNC_LIST _func_list;
_func_list.dynamic_func_a_ = (i_dynamic_func_a)CAlgorithms::Example01;
_func_list.dynamic_func_b_ = (i_dynamic_func_b)CAlgorithms::Example02;
_func_list.dynamic_func_c_ = (i_dynamic_func_c)CAlgorithms::Example03;
g_map_functions.insert(std::make_pair("EXAMPLE0",_func_list));
_func_list.dynamic_func_a_ = (i_dynamic_func_a)CAlgorithms::Example11;
_func_list.dynamic_func_b_ = (i_dynamic_func_b)CAlgorithms::Example12;
_func_list.dynamic_func_c_ = (i_dynamic_func_c)CAlgorithms::Example13;
g_map_functions.insert(std::make_pair("EXAMPLE1",_func_list));
// To do, add more functions in the following ......
//...
return true;
}
void dynamic_func_a(std::string _name,float _arg_input, float &_arg_output)
{
if(g_map_functions.count(_name) > 0)
g_map_functions[_name].dynamic_func_a_(_arg_input,_arg_output);
}
void dynamic_func_b(std::string _name,std::deque<float> _arg_input, std::deque<float> &_arg_output)
{
if(g_map_functions.count(_name) > 0)
g_map_functions[_name].dynamic_func_b_(_arg_input,_arg_output);
}
void dynamic_func_c(std::string _name, std::deque< std::deque<float> > _arg_input, std::deque<float> &_arg_output)
{
if(g_map_functions.count(_name) > 0)
g_map_functions[_name].dynamic_func_c_(_arg_input,_arg_output);
}
void dynamic_func_d(std::string _name, std::deque< std::deque<float> > _arg_input, std::deque< std::deque<float> > &_arg_output)
{
if(g_map_functions.count(_name) > 0)
g_map_functions[_name].dynamic_func_d_(_arg_input,_arg_output);
} | [
"150244609@qq.com"
] | 150244609@qq.com |
8780d958e63d0b0ebd5a837574dfd0936253c9d2 | eb667f1737a67feb07bf2d1298ff6757526ee8fb | /587 Erect the Fence/Erect the Fence.cpp | bc91c42f7ab56fb84d5f939b30ca44e69d49d2e8 | [] | no_license | yukeyi/LeetCode | bb3313a868e9aedada3fe157c6307b00d32a09c9 | 79d37be2aefd674e885a5bdc6dac0a5adf02f91c | refs/heads/master | 2021-04-18T22:18:26.085485 | 2019-06-09T06:25:29 | 2019-06-09T06:25:29 | 126,930,413 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 918 | cpp | class Solution {
public:
vector<vector<int>> outerTrees(vector<vector<int>>& points) {
sort(points.begin(),points.end());
vector<vector<int>> res;
for(int i = 0;i<points.size();i++) {
while(res.size() > 1 && orientation(res[res.size()-2],res[res.size()-1],points[i]) < 0)
res.pop_back();
res.push_back(points[i]);
}
if(res.size() == points.size())
return res;
for(int i = points.size()-2;i>=0;i--) {
while(res.size() > 1 && orientation(res[res.size()-2],res[res.size()-1],points[i]) < 0)
res.pop_back();
res.push_back(points[i]);
}
res.pop_back();
return res;
}
int orientation(vector<int>& a, vector<int>& b, vector<int>& c) {
return (b[0]-a[0])*(c[1]-b[1]) - (b[1]-a[1])*(c[0]-b[0]);
}
}; | [
"yukeyi14@163.com"
] | yukeyi14@163.com |
4a610b3ade0584ad83f7c8ce2a3c5a2db448765e | 3354cbb1c02fa2955ced733ae35fa52f366ef08b | /src/voxel_trajectory/voxelgraph.cpp | bc739ef66614aa1e205a27d037d0bb97fc292157 | [] | no_license | oridong/voxel_trajectory | 865abee413aa1afb7cc4d0bbb3e3d9db9fc8fa03 | 9f0174c3d3ef3d771faf7f2a3dfb4c97ee21c973 | refs/heads/master | 2023-03-18T02:06:07.415193 | 2019-02-20T09:49:13 | 2019-02-20T09:49:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,718 | cpp |
#include "voxel_trajectory/voxelmacro.h"
#include "voxel_trajectory/voxelgraph.h"
#include "voxel_trajectory/octomap.h"
#include <cmath>
#include <string.h>
#include <algorithm>
#include <map>
#include <iostream>
const static int _EDGE_NULL = -1;
const static int _NODE_NULL = -1;
static int _NODE_S = 0;
static int _NODE_T = 1;
const static double _TURN_PENALTY = 1.6;
const static double _EPS = 1e-9;
const static double _INF = 1e100;
namespace VoxelTrajectory
{
using namespace std;
VoxelGraph::Node::Node(int beg, double bdy[_TOT_BDY])
{
this->beg = beg;
memcpy(this->bdy, bdy, sizeof(this->bdy));
}
VoxelGraph::Edge::Edge(int nxt, double cost, int bid, int to)
{
this->nxt = nxt;
this->cost = cost;
this->bid = bid;
this->to = to;
}
void VoxelGraph::addNode(double bdy[_TOT_BDY])
{
node.push_back(Node(_EDGE_NULL, bdy));
N += 1;
}
void VoxelGraph::addEdge(int from_u, int to_v, double cost, int bid)
{
edge.push_back(Edge(node[from_u].beg, cost, bid, to_v));
node[from_u].beg = E;
E +=1;
}
static inline int getRevEdgeID(int eid)
{
return eid^1;
}
void VoxelGraph::SetUp(double pt_s[_TOT_DIM], double pt_t[_TOT_DIM], OctoMap * octomap)
{
double bdy_s[_TOT_BDY]=
{
pt_s[_DIM_x], pt_s[_DIM_x] + _EPS,
pt_s[_DIM_y], pt_s[_DIM_y] + _EPS,
pt_s[_DIM_z], pt_s[_DIM_z] + _EPS
};
double bdy_t[_TOT_BDY]=
{
pt_t[_DIM_x], pt_t[_DIM_x] + _EPS,
pt_t[_DIM_y], pt_t[_DIM_y] + _EPS,
pt_t[_DIM_z], pt_t[_DIM_z] + _EPS
};
#if _USE_DEBUG_PRINT_
for (int j = 0; j < 6; j++) clog<<bdy_s[j]<<",";
clog<<"\n";
clog<<"[bdy_t] = ";
for (int j = 0; j < 6; j++) clog<<bdy_t[j]<<",";
clog<<"\n";
#endif
int old_E = E, old_N = N, old_pr = bid_nid.size();
octomap->query(1, -1, bdy_s, this);
octomap->query(1, -2, bdy_t, this);
#if 0
clog
<< bdy_s[0] <<" |"
<< bdy_s[1] <<" |"
<< bdy_s[2] <<" |"
<< bdy_s[3] <<" |"
<< bdy_s[4] <<" |"
<< bdy_s[5] <<"\n";
clog
<< bdy_t[0] << " |"
<< bdy_t[1] << " |"
<< bdy_t[2] << " |"
<< bdy_t[3] << " |"
<< bdy_t[4] << " |"
<< bdy_t[5] << "\n";
#endif
connectNodesWithSameBid(old_pr);
//clog<<"graph = " << bid_nid.size() <<" [ "<< E << "," << old_E <<"],["<< N << "," << old_N << " ]\n";
// For path
hasGotPath = false;
_path_ = getPath(octomap);
// For recovery
E = old_E;
N = old_N;
for (int u = 0; u < N; ++ u)
while (node[u].beg > E)
node[u].beg = edge[node[u].beg].nxt;
node.resize(N);
edge.resize(E);
bid_nid.resize(old_pr);
}
VoxelGraph::VoxelGraph(OctoMap * octomap)
{
N = 0;
E = 0;
hasGotPath = false;
octomap->retGraph(this);
connectNodesWithSameBid(0);
}
static inline double getSurface(double bdy[_TOT_BDY])
{
double x = bdy[_BDY_X] - bdy[_BDY_x];
double y = bdy[_BDY_Y] - bdy[_BDY_y];
double z = bdy[_BDY_Z] - bdy[_BDY_z];
double surface = (x * y + y * z + z * x) * 2.0;
return surface;
}
static inline bool isAllowed(double bdy[_TOT_BDY])
{
return
bdy[_BDY_x] < bdy[_BDY_X] &&
bdy[_BDY_y] < bdy[_BDY_Y] &&
bdy[_BDY_z] < bdy[_BDY_Z];
}
void VoxelGraph::add_bdy_id_id(double bdy[_TOT_BDY], int bid_a, int bid_b)
{
//if (isAllowed(bdy)) return ;
bid_nid.push_back(std::pair<int, int>(bid_a, N));
bid_nid.push_back(std::pair<int, int>(bid_b, N));
#if 0
{
std::cout<<"surface="<<getSurface(bdy)<<","<<(getSurface(bdy)>_EPS)<<std::endl;
std::cout<<"\t"<<bdy[0]<<","<<bdy[1]<<std::endl;
std::cout<<"\t"<<bdy[2]<<","<<bdy[3]<<std::endl;
std::cout<<"\t"<<bdy[4]<<","<<bdy[5]<<std::endl;
}
#endif
addNode(bdy);
}
static inline double sqr(double x) {return x * x;}
static inline double norm(double pt_a[_TOT_DIM], double pt_b[_TOT_DIM])
{
return std::sqrt(
sqr(pt_a[_DIM_x] - pt_b[_DIM_x]) +
sqr(pt_a[_DIM_y] - pt_b[_DIM_y]) +
sqr(pt_a[_DIM_z] - pt_b[_DIM_z]));
}
static inline double getDistance(double bdy_a[_TOT_BDY], double bdy_b[_TOT_BDY])
{
double a[_TOT_DIM]=
{
(bdy_a[_BDY_x] + bdy_a[_BDY_X]) * 0.5,
(bdy_a[_BDY_y] + bdy_a[_BDY_Y]) * 0.5,
(bdy_a[_BDY_z] + bdy_a[_BDY_Z]) * 0.5
};
double b[_TOT_DIM]=
{
(bdy_b[_BDY_x] + bdy_b[_BDY_X]) * 0.5,
(bdy_b[_BDY_y] + bdy_b[_BDY_Y]) * 0.5,
(bdy_b[_BDY_z] + bdy_b[_BDY_Z]) * 0.5
};
return norm(a, b);
}
static inline double max(double a, double b){ return (a > b) ? a : b;}
static inline double min(double a, double b){ return (a < b) ? a : b;}
static inline double getTurnCost(double bdy_a[_TOT_BDY], double bdy_b[_TOT_BDY])
{
double bdy[_TOT_BDY] =
{
max(bdy_a[_BDY_x], bdy_b[_BDY_x]), min(bdy_a[_BDY_X], bdy_b[_BDY_X]),
max(bdy_a[_BDY_y], bdy_b[_BDY_y]), min(bdy_a[_BDY_Y], bdy_b[_BDY_Y]),
max(bdy_a[_BDY_z], bdy_b[_BDY_z]), min(bdy_a[_BDY_Z], bdy_b[_BDY_Z]),
};
if (
(bdy[_BDY_X] - bdy[_BDY_x]) *
(bdy[_BDY_Y] - bdy[_BDY_y]) *
(bdy[_BDY_Z] - bdy[_BDY_z]) >
_EPS)
return _TURN_PENALTY;
else
return 1.0;
}
void VoxelGraph::connectNodesWithSameBid(int beg)
{
if (beg == 0)
sort(bid_nid.begin(), bid_nid.end());
for (int i = beg; i < bid_nid.size(); i++)
{
int bid = bid_nid[i].first;
int u = bid_nid[i].second;
int v;
for (int j = i - 1; j >= 0; --j)
{
if (bid_nid[j].first != bid)
if (beg == 0)
break;
else
continue;
v = bid_nid[j].second;
double cost = getDistance(node[u].bdy, node[v].bdy);
if (beg == 0) cost *= getTurnCost(node[u].bdy, node[v].bdy);
addEdge(u, v, cost, bid);
addEdge(v, u, cost, bid);
}
}
}
void VoxelGraph::calBestPath()
{
if (hasGotPath || node.size() < 2) return ;
_NODE_S = N - 2;
_NODE_T = N - 1;
std::multimap<double,int> weight2nid;
std::vector<double> best(N, _INF);
std::vector<int> last(N, _NODE_NULL);
std::vector<double> heu(N);
//std::cout<<"OK1,n="<<N<<std::endl;
for (int nid = 0; nid < N; nid++)
heu[nid] = getDistance(node[nid].bdy, node[_NODE_T].bdy);
//std::cout<<"OK2,E="<<E<<std::endl;
int u = _NODE_S, v, eid;
best[u] = 0;
//std::cout<<"OK3,n="<<node.size()<<std::endl;
while (u != _NODE_T)
{
//std::cout<<"ok4,u="<<u<<","<<std::endl;
//std::cout<<"ok4,eid="<<eid<<","<<std::endl;
//std::cout<<"ok4,u_eid="<<node[u].beg<<","<<_EDGE_NULL<<std::endl;
for (eid = node[u].beg; eid != _EDGE_NULL; eid=edge[eid].nxt)
{
//std::cout<<"bool="<<(eid!=_EDGE_NULL)<<std::endl;
v = edge[eid].to;
//std::cout<<"v="<<v<<std::endl;
if (best[u] + edge[eid].cost <best[v])
{
best[v] = best[u] + edge[eid].cost;
last[v] = eid;
weight2nid.insert(std::pair<double, int>(best[v] + heu[v], v));
}
}
//std::cout<<"ok5,"<<weight2nid.size()<<","<<std::endl;
std::multimap<double, int>::iterator it = weight2nid.begin();
if (it == weight2nid.end()) break ;
u = it->second;
weight2nid.erase(it);
}
if (last[_NODE_T] == _NODE_NULL) return ;
u = _NODE_T;
path_nid = vector<int> (0);
path_bid = vector<int> (0);
while (u!=_NODE_S)
{
eid = getRevEdgeID(last[u]);
u = edge[eid].to;
path_nid.push_back(u);
path_bid.push_back(edge[eid].bid);
}
hasGotPath = true;
}
Eigen::MatrixXd VoxelGraph::getPath(OctoMap *octomap)
{
//std::cout<<"OK,"<<std::endl;
calBestPath();
//clog << "HasGotPath" << hasGotPath <<std::endl;
if (!hasGotPath) return Eigen::MatrixXd(0, 0);
int M = path_bid.size(), mid = 0;
//std::cout<<"M="<<M<<std::endl;
Eigen::MatrixXd ret(2 * M, _TOT_BDY);
#if 1
ret.row(mid++)<<
node[_NODE_S].bdy[_BDY_x],
node[_NODE_S].bdy[_BDY_y],
node[_NODE_S].bdy[_BDY_z],
node[_NODE_T].bdy[_BDY_x],
node[_NODE_T].bdy[_BDY_y],
node[_NODE_T].bdy[_BDY_z];
//std::cout<<"Mid="<<mid<<std::endl;
double box[_TOT_BDY];
for (int pid = M - 1; pid >= 0; pid--)
{
octomap->retBox(path_bid[pid],box);
//std::cout<<"box_bdy,bid="<<path_bid[pid]<<std::endl;
//std::cout<<"\t"<<box[0]<<","<<box[1]<<std::endl;
//std::cout<<"\t"<<box[2]<<","<<box[3]<<std::endl;
//std::cout<<"\t"<<box[4]<<","<<box[5]<<std::endl;
ret.row(mid++)<<
box[_BDY_x], box[_BDY_X],
box[_BDY_y], box[_BDY_Y],
box[_BDY_z], box[_BDY_Z];
}
//std::cout<<"Mid="<<mid<<std::endl;
double *win;
for (int pid = M - 2; pid >= 0; pid--)
{
win = node[path_nid[pid]].bdy;
//std::cout<<"windows_bdy"<<std::endl;
//std::cout<<"\t"<<win[0]<<","<<win[1]<<std::endl;
//std::cout<<"\t"<<win[2]<<","<<win[3]<<std::endl;
//std::cout<<"\t"<<win[4]<<","<<win[5]<<std::endl;
ret.row(mid++)<<
win[_BDY_x], win[_BDY_X],
win[_BDY_y], win[_BDY_Y],
win[_BDY_z], win[_BDY_Z];
}
#endif
return ret;
}
}
| [
"jchenbr@ust.hk"
] | jchenbr@ust.hk |
a503d8d1983f69b8678e07f75ccb3f41f482decb | d0f43b61797fc8f17cbbb7635415cf6708fb8f94 | /digitdetector.h | 1cf912fe0a522cd78315c4f6b61901a1cfafd11b | [] | no_license | khaemn/digit_detector_adr_cpp | 6ecc4e2adb8b8d25065cf71917b7c28bea311255 | d1fd6453e523029b685b469ded0a2fdcdcb4a622 | refs/heads/master | 2020-04-27T12:32:47.840131 | 2019-03-07T16:44:17 | 2019-03-07T16:44:17 | 174,335,174 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 965 | h | #ifndef DIGITDETECTOR_H
#define DIGITDETECTOR_H
#include <memory>
#include <QObject>
#include <fdeep/fdeep.hpp>
#include <opencv2/imgproc.hpp>
class DigitDetector : public QObject
{
Q_OBJECT
Q_PROPERTY(QString digit READ digit NOTIFY digitChanged)
public:
explicit DigitDetector(QObject *parent = nullptr);
// For debug only.
void init();
Q_INVOKABLE void test_recognizing(const QString& file);
QString digit() const;
static constexpr auto MNIST_WIDTH = 28;
static constexpr auto MNIST_HEIGHT = 28;
static void registerQmlType();
signals:
void digitChanged(QString digit);
public slots:
private:
fdeep::tensor5 as_native_tensor(const cv::Mat& input);
fdeep::tensor5 raw_predict(const fdeep::tensor5& input);
cv::Mat as_cv_mat(const fdeep::tensor5& input);
private:
QString m_digit;
QString m_res_path_prefix;
std::unique_ptr<fdeep::model> m_model;
};
#endif // DIGITDETECTOR_H
| [
"voh@ciklum.com"
] | voh@ciklum.com |
e52773fbe024ec26a393738d84f79e9aa275aac6 | bf3714517131f51da494768270a2a5eeb8a221a8 | /src/utils/TimeMeasurer.h | 4f8d88dba25ce8bcfbab51534c2e239c1b42967f | [
"MIT"
] | permissive | AAAAgito/SubgraphMatchGPU_sigmod2020 | a0edbfcc9e98d02cd15b6bba955c1cd80d11ac0e | 984be6b7920fe2c5e228488ac08c1d166885e468 | refs/heads/master | 2023-04-27T03:55:28.870190 | 2020-10-28T00:07:42 | 2020-10-28T00:07:42 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 634 | h | #ifndef __TIME_MEASURER_H__
#define __TIME_MEASURER_H__
#include <stdlib.h>
#include <sys/time.h>
class TimeMeasurer {
public:
TimeMeasurer() {}
~TimeMeasurer() {}
void StartTimer() { start_timestamp = wtime(); }
void EndTimer() { end_timestamp = wtime(); }
double GetElapsedMicroSeconds() const {
return end_timestamp - start_timestamp;
}
double wtime() {
double time[2];
struct timeval time1;
gettimeofday(&time1, NULL);
time[0] = time1.tv_sec;
time[1] = time1.tv_usec;
return time[0] * (1.0e6) + time[1];
}
private:
double start_timestamp;
double end_timestamp;
};
#endif
| [
"guowentian1992@gmail.com"
] | guowentian1992@gmail.com |
c852dcf4019211e731f5ea6cf6757cfa672f7bab | 69c14de94687d0bfaafcc24083ab8113dc11c177 | /CharRecoHelper.cpp | b5760a89a89a9c5556497f70de56c413d7bb09dc | [] | no_license | songshine/DigitReco | 080da69cef6781339029c091a53139595412d64d | fb2479509d30afda93c160019323c6bc608260d0 | refs/heads/master | 2020-04-29T18:48:48.453176 | 2015-09-13T03:02:42 | 2015-09-13T03:02:42 | 23,995,204 | 3 | 2 | null | null | null | null | GB18030 | C++ | false | false | 1,252 | cpp | #include "StdAfx.h"
#include "CharRecoHelper.h"
#include <cv.h>
#include <highgui.h>
#include <cvaux.h>
#define TEMPLATE_PATH "DigitTemplatesTrain" //模版位置
#define DEFAULT_SAMPLE_WIDTH 24
#define DEFAULT_SAMPLE_HEIGHT 48
#define DEFAULT_POINT_NUM 66 //默认从字上面取的点数
CharRecoHelper::CharRecoHelper()
{
templatePath = (char*)malloc(sizeof(char)*1024);
strcpy(templatePath,TEMPLATE_PATH);
sc_prob.nbins_theta = 12;
sc_prob.nbins_r = 5;
sc_prob.r_inner = 0.125;
sc_prob.r_outer = 2.0;
nExtractPoints = DEFAULT_POINT_NUM;
}
IplImage* CharRecoHelper::Convert2Edge(const IplImage* img)
{
IplImage* dst = cvCreateImage(cvSize(DEFAULT_SAMPLE_WIDTH,DEFAULT_SAMPLE_HEIGHT),
IPL_DEPTH_8U,1);
cvResize(img,dst);
//中值滤波
//cvSmooth(dst,dst,CV_MEDIAN);
//求边缘图
cvCanny(dst,dst,50,150,7);
return dst;
}
char CharRecoHelper::ConvertFileToChar(char* fileName)
{
char result = '#';
if(fileName != NULL && strlen(fileName) > 2)
{
if(fileName[1] != '.')
{
if(fileName[0] >= 'a' && fileName[0] <= 'z')
{
result = fileName[0]-32;
}
else if(fileName[0] >= '0' && fileName[0] <= '9')
{
result = fileName[0];
}
}
else
{
result = fileName[0];
}
}
return result;
} | [
"zxysong110@gmail.com"
] | zxysong110@gmail.com |
e6d402e75b9a3681fa89c2c071ece09c10ff6182 | fb6836c3cf078c1e78962f9d4e54fac0d3ba31c1 | /LintCode-Cpp/DFS-Graph/LetterCombinationPhonePad.cpp | deab7c1221873b5179ad283f0b8493551c3dc9c4 | [] | no_license | squidieee/AlgorithmPractice | dba27f0a52a7d0f6057e186ee491c5e6c81dd485 | 99b5d1c92405e3c3e9f123ac80645aeb8993f13b | refs/heads/master | 2022-04-09T00:18:04.983834 | 2020-03-25T08:17:52 | 2020-03-25T08:17:52 | 112,406,812 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,546 | cpp | /*
425. Letter Combinations of a Phone Number
Given a digit string excluded 01, return all possible letter combinations that the number could represent.
A mapping of digit to letters (just like on the telephone buttons) is given below.
*/
class Solution {
public:
/**
* @param digits: A digital string
* @return: all posible letter combinations
*/
vector<string> letterCombinations(string &digits) {
vector<string> results;
if (digits.empty()) return results;
string subset;
vector<string> table{"abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"};
dfs(digits, 0, subset, results,table);
return results;
}
// take one number from digits, for each of its possible letter, add it to subset
// if subset.size() == digits.size(), add to results
// otherwise call next level
void dfs(string &digits, int index, string& subset, vector<string>& results, vector<string>& table)
{
if (index > digits.size() - 1)
return;
int number = digits[index] - '2';
for(int i = 0; i < table[number].size(); i++)
{
char c = table[number][i];
subset.push_back(c);
if (subset.size() == digits.size())
{
results.push_back(subset);
}
else
{
dfs(digits, index + 1, subset, results, table);
}
subset.pop_back();
}
}
}; | [
"qzhou@ece.ubc.ca"
] | qzhou@ece.ubc.ca |
ddc2d5b15da7040bbd8289826996f97e61f34c63 | 46ed06031ec9578846e728a0522daf81ee2133f7 | /PIRockCV/ends.cpp | a5be9a37acffb2e6acc16c599a63e39ec40ca580 | [] | no_license | daveansell/picam-gpu | 1fe2232501983c63329a4c62ae35a4dcbf6fea2c | cc8e038418730ff1889725a5a3b345a832d096e8 | refs/heads/master | 2021-05-13T16:53:35.130377 | 2016-07-12T23:44:54 | 2016-07-12T23:44:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,621 | cpp | #include "ends.hpp"
#include <fstream>
#include <iomanip>
#include <cmath>
using namespace std;
vector< tuple<size_t, size_t, double> > kalmanPairings(vector<KalmanRock> kalmans, vector<Rock> rocks, double time_step, vector<size_t> &rock_indices);
void KalmanFrame :: timeUpdate(double time_step)
{
for (KalmanRock kalman : red_kalmans) {
kalman.timeUpdate(time_step);
}
for (KalmanRock kalman : yellow_kalmans) {
kalman.timeUpdate(time_step);
}
}
static void trackUpdate(vector<KalmanRock> &kalmans, vector<Rock> &rocks, double time_step, size_t frame)
{
/* Create associations */
/* Find min prob kalman rock pairs greedily. */
/* If this is above probability threshold update kalman with rock, otherwise don't */
vector<size_t> remaining_rocks;
vector< tuple<size_t, size_t, double> > pairings = kalmanPairings(kalmans, rocks, time_step, remaining_rocks);
for (tuple<size_t, size_t, double> pair : pairings) {
size_t kalman_ind = get<0>(pair);
size_t rock_ind = get<1>(pair);
double metric_val = get<2>(pair);
if (metric_val < COVAR_THRESH) {
kalmans[kalman_ind].rockUpdate(rocks[rock_ind], time_step);
}
else {
KalmanRock new_kalman(rocks[rock_ind], frame);
kalmans.push_back(new_kalman);
}
}
/* Each rock that is not associated with a Kalman filter now becomes one */
for (size_t rock_ind : remaining_rocks) {
KalmanRock new_kalman(rocks[rock_ind], frame);
kalmans.push_back(new_kalman);
}
}
void KalmanFrame :: rockUpdate(vector<Rock> &red_rocks, vector<Rock> &yellow_rocks, double time_step, size_t frame)
{
trackUpdate(red_kalmans, red_rocks, time_step, frame);
trackUpdate(yellow_kalmans, yellow_rocks, time_step, frame);
}
void EndState :: advanceFrame(double time_step, vector<Rock> &red_rocks, vector<Rock> &yellow_rocks)
{
/* Save frame */
frame_times.push_back(time_step);
/* Create next frame of KalmanRocks... */
KalmanFrame next_frame;
if (frames.size() > 0) {
next_frame = frames.back();
}
next_frame.timeUpdate(time_step);
/* Get KalmanRocks for each Rock we've seen this frame */
/* Associate + create new tracks if necessary */
next_frame.rockUpdate(red_rocks, yellow_rocks, time_step, frames.size());
/* Now that we have KalmanRocks, save the frame */
frames.push_back(next_frame);
}
/* Kalman, rock, prob */
tuple<ssize_t, ssize_t, double> minKalmanRockPair(vector<KalmanRock> &kalmans, vector<Rock> &rocks, double time_step, double metric(KalmanRock, Rock, double))
{
if (kalmans.size() == 0 || rocks.size() == 0) {
tuple<ssize_t, ssize_t, double> new_pair(-1, -1, -1);
return new_pair;
}
double min = metric(kalmans[0], rocks[0], time_step);
ssize_t min_rock_ind = 0;
ssize_t min_kalman_ind = 0;
for (size_t rock_ind = 0; rock_ind < rocks.size(); ++rock_ind) {
for (size_t kalman_ind = 0; kalman_ind < kalmans.size(); ++kalman_ind) {
double val = metric(kalmans[kalman_ind], rocks[rock_ind], time_step);
if (val < min) {
min_rock_ind = rock_ind;
min_kalman_ind = kalman_ind;
min = val;
}
}
}
tuple<ssize_t, ssize_t, double> new_pair(min_kalman_ind, min_rock_ind, min);
return new_pair;
}
//Not used
/*static double distMetric(KalmanRock kalman, Rock rock, double time_step)
{
return rockDist(kalman.rock, rock);
}*/
static double probMetric(KalmanRock kalman, Rock rock, double time_step)
{
return kalman.kalmanCovarianceSize(rock, time_step);
}
/* Kalman, rock, prob */
vector< tuple<size_t, size_t, double> > kalmanPairings(vector<KalmanRock> kalmans, vector<Rock> rocks, double time_step, vector<size_t> &rock_indices)
{
/* Index vectors */
vector<size_t> kalman_indices;
for (size_t i = 0; i < kalmans.size(); ++i) {
kalman_indices.push_back(i);
}
for (size_t i = 0; i < rocks.size(); ++i) {
rock_indices.push_back(i);
}
/* Pair rock with nearest kalman rock */
vector< tuple<size_t, size_t, double> > pairs;
while (1) {
tuple<ssize_t, ssize_t, double> min_pair = minKalmanRockPair(kalmans, rocks, time_step, probMetric);
ssize_t min_kalman_ind = get<0>(min_pair);
ssize_t min_rock_ind = get<1>(min_pair);
ssize_t min_val = get<2>(min_pair);
if (min_kalman_ind == -1) {
break;
}
tuple<size_t, size_t, double> new_pair(kalman_indices[min_kalman_ind], rock_indices[min_rock_ind], min_val);
pairs.push_back(new_pair);
/* Get rid of used indices */
kalmans.erase(kalmans.begin() + min_kalman_ind);
kalman_indices.erase(kalman_indices.begin() + min_kalman_ind);
rocks.erase(rocks.begin() + min_rock_ind);
rock_indices.erase(rock_indices.begin() + min_rock_ind);
}
return pairs;
}
String KalmanFrame :: toString(bool redFirst)
{
ostringstream concat;
if (redFirst) concat << toLogString(red_kalmans) << " | " << toLogString(yellow_kalmans);
else concat << toLogString(yellow_kalmans) << " | " << toLogString(red_kalmans);
return concat.str();
}
String EndState :: toString(bool redFirst)
{
if (frames.size() > 0) {
ostringstream concat;
//concat << "(" << frames.size() << ")" << frames.back().toString(redFirst);
concat << frames.back().toString(redFirst);
return concat.str();
}
return "";
}
| [
"carmodiedre@outlook.com"
] | carmodiedre@outlook.com |
a471a90137a9e95f4f6fa2720475d35a00587e9d | 89993da44987030ed40ea14d3c60ebc95cd1addd | /oop4/BackUp.h | 8ad7f94e42c4f1d4fb939b07b468ab72dd85a5dd | [] | no_license | cats-will/oop | 8b12e3cd2bb3cc46a639bed948b3c154933914eb | 946e850fdb35203fdf2c036e69b85026393b3bf7 | refs/heads/master | 2023-02-08T05:57:52.181234 | 2020-12-25T14:23:41 | 2020-12-25T14:23:41 | 300,069,065 | 0 | 1 | null | 2020-11-27T16:59:15 | 2020-09-30T21:36:00 | C++ | UTF-8 | C++ | false | false | 494 | h | #pragma once
#include <utility>
#include "Storage.h"
#include "IRestorePoint.h"
class BackUp {
boost::uuids::uuid UUID;
boost::posix_time::ptime CreationTime = boost::posix_time::second_clock::local_time();
std::list<IRestorePoint *> rp;
int size;
public:
BackUp() = default;
BackUp(std::list<IRestorePoint *> rp);
boost::uuids::uuid GetUUID() const;
boost::posix_time::ptime GetCreationTime() const;
int GetSize() const;
};
| [
"leika181@rambler.ru"
] | leika181@rambler.ru |
f02c23ee62ce91da9cdde0773f1d3206a9f018fc | a33aac97878b2cb15677be26e308cbc46e2862d2 | /program_data/PKU_raw/3/1539.c | 716d3d91282e08a3a2fe1e65aedf730f0635fdac | [] | no_license | GabeOchieng/ggnn.tensorflow | f5d7d0bca52258336fc12c9de6ae38223f28f786 | 7c62c0e8427bea6c8bec2cebf157b6f1ea70a213 | refs/heads/master | 2022-05-30T11:17:42.278048 | 2020-05-02T11:33:31 | 2020-05-02T11:33:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 260 | c | int main()
{
int n,i,j,k;
scanf("%d %d",&n,&k);
int a[n];
int b[n];
for(i=0;i<n;i++)
{
scanf("%d ",&a[i]);
b[i]=k-a[i];
}
int m=0;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
if(b[j]==a[i])m++;
}
}
if(m>0) printf("yes");
else printf("no");
}
| [
"bdqnghi@gmail.com"
] | bdqnghi@gmail.com |
5c12e6d2eaf466637310038dfb2cd90f73968c0a | 5828584abf43a752a16d3b212a97b1e8ad0aeda8 | /muduo/net/Endian.h | 1a13fc43c44c76c107b54a1edbdbb9db8c745e0c | [] | no_license | sofartogo/muduo-re | 50557a19fbb3fbfd00c4b9c265a390cbf0dfc23e | 97de917c15dcfb67e3b19397b365fd17a799618d | refs/heads/master | 2021-01-23T13:31:24.864271 | 2013-03-09T14:48:36 | 2013-03-09T14:48:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,427 | h | /*
* =============================================================================
*
* Filename: Endian.h
*
* Description:
*
* Version: 1.0
* Created: 10/17/2012 04:25:21 PM
* Revision: r1
* Compiler: gcc (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5
*
* Author: Wang Wei (sofartogo), wangwei881116@gmail.com
* Company: ICT ( Institute Of Computing Technology, CAS )
*
* =============================================================================
*/
#ifndef MUDUO_NET_ENDIAN_H
#define MUDUO_NET_ENDIAN_H
#include <stdint.h>
#include <endian.h>
namespace muduo
{
namespace net
{
namespace sockets
{
// the inline assembler code makes type blur,
// so we disable warnings for a while.
#pragma GCC diagnostic ignored "-Wconversion"
#pragma GCC diagnostic ignored "-Wold-style-cast"
inline uint64_t hostToNetwork64(uint64_t host64)
{
return htobe64(host64);
}
inline uint32_t hostToNetwork32(uint32_t host32)
{
return htobe32(host32);
}
inline uint16_t hostToNetwork16(uint16_t host16)
{
return htobe16(host16);
}
inline uint64_t networkToHost64(uint64_t net64)
{
return be64toh(net64);
}
inline uint32_t networkToHost32(uint32_t net32)
{
return be32toh(net32);
}
inline uint16_t networkToHost16(uint16_t net16)
{
return be16toh(net16);
}
#pragma GCC diagnostic error "-Wconversion"
#pragma GCC diagnostic error "-Wold-style-cast"
}
}
}
#endif
| [
"wangwei881116@gmail.com"
] | wangwei881116@gmail.com |
aa99aa0f68436cff5c239ef80cf2a0fb37992f2c | ac6c9141d78b18f9730e474d391e53995b04e5da | /src/Ragnar/UtpStatus.h | 1de6579ab6a96cb36ea50c00450eb9e172a2a54d | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Tlaster/ragnar | 25fd9c787345ae669facc641484bbe35a4b9c9d1 | 6f56c6fae6e788206d98d065558ed78bdfc72949 | refs/heads/develop | 2021-01-21T08:46:15.844724 | 2015-11-16T12:15:52 | 2015-11-16T12:15:52 | 46,044,756 | 3 | 2 | null | 2015-11-12T10:12:16 | 2015-11-12T10:07:54 | C++ | UTF-8 | C++ | false | false | 462 | h | #pragma once
namespace libtorrent
{
struct utp_status;
}
namespace Ragnar
{
public ref class UtpStatus
{
private:
libtorrent::utp_status* _utp_status;
internal:
UtpStatus(const libtorrent::utp_status &utp_status);
public:
~UtpStatus();
property int NumIdle { int get(); }
property int NumSynSent { int get(); }
property int NumConnected { int get(); }
property int NumFinSent { int get(); }
property int NumCloseWait { int get(); }
};
} | [
"omar.zanhour@outlook.com"
] | omar.zanhour@outlook.com |
d9dabbd78004d24fb004b87280a01a5f8c05218f | 47ebaa434e78c396c4e6baa14f0b78073f08a549 | /branches/latestClient/server/src/network/network.cpp | 042ce22dd53b33eda6c8cd06fe428a8e91f516f9 | [] | no_license | BackupTheBerlios/wolfpack-svn | d0730dc59b6c78c6b517702e3825dd98410c2afd | 4f738947dd076479af3db0251fb040cd665544d0 | refs/heads/master | 2021-10-13T13:52:36.548015 | 2013-11-01T01:16:57 | 2013-11-01T01:16:57 | 40,748,157 | 1 | 2 | null | 2021-09-30T04:28:19 | 2015-08-15T05:35:25 | C++ | UTF-8 | C++ | false | false | 6,463 | cpp | /*
* Wolfpack Emu (WP)
* UO Server Emulation Program
*
* Copyright 2001-2007 by holders identified in AUTHORS.txt
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA.
*
* In addition to that license, if you are running this program or modified
* versions of it on a public system you HAVE TO make the complete source of
* the version used by you available or provide people with a location to
* download it.
*
* Wolfpack Homepage: http://developer.berlios.de/projects/wolfpack/
*/
// Platform Includes
#include "../platform.h"
//Wolfpack Includes
#include "network.h"
#include "../serverconfig.h"
#include "../console.h"
#include "../inlines.h"
#include "uosocket.h"
#include "../basechar.h"
#include "../player.h"
#include "../exceptions.h"
// Library Includes
#include <QStringList>
#include <QList>
#include <QTcpServer>
class cNetwork::cNetworkPrivate
{
public:
QList<cUOSocket*> uoSockets;
QList<cUOSocket*> loginSockets;
QMutableListIterator<cUOSocket*> internalIterator;
QTcpServer* loginServer_;
QTcpServer* gameServer_;
QMutex mutex;
cNetworkPrivate() : internalIterator( uoSockets )
{
loginServer_ = 0;
gameServer_ = 0;
}
~cNetworkPrivate()
{
foreach (cUOSocket *socket, uoSockets) {
delete socket;
}
foreach (cUOSocket *socket, loginSockets) {
delete socket;
}
delete loginServer_;
delete gameServer_;
}
};
cNetwork::cNetwork() : d( new cNetworkPrivate )
{
}
cNetwork::~cNetwork()
{
delete d;
}
void cNetwork::incomingGameServerConnection()
{
QTcpSocket* socket = d->gameServer_->nextPendingConnection();
cUOSocket *uosocket = new cUOSocket( socket );
d->uoSockets.append( uosocket );
connect( uosocket, SIGNAL(disconnected()), this, SLOT(partingGameServerConnection()) );
// Notify the admin
uosocket->log( tr( "Client '%1' connected to game server.\n" ).arg( socket->peerAddress().toString() ) );
}
void cNetwork::incomingLoginServerConnection()
{
QTcpSocket* socket = d->loginServer_->nextPendingConnection();
cUOSocket *uosocket = new cUOSocket( socket );
d->loginSockets.append( uosocket );
connect( uosocket, SIGNAL(disconnected()), this, SLOT(partingLoginServerConnection()) );
// Notify the admin
uosocket->log( tr( "Client '%1' connected to login server.\n" ).arg( socket->peerAddress().toString() ) );
}
void cNetwork::partingLoginServerConnection()
{
cUOSocket* uoSocket = qobject_cast<cUOSocket *>( sender() );
uoSocket->disconnect();
d->loginSockets.removeAll( uoSocket );
uoSocket->deleteLater();
uoSocket->log( tr( "Client '%1' disconnected from loginserver.\n" ).arg( uoSocket->ip()) );
}
void cNetwork::partingGameServerConnection()
{
cUOSocket* uoSocket = qobject_cast<cUOSocket *>(sender());
uoSocket->disconnect();
d->uoSockets.removeAll( uoSocket );
uoSocket->deleteLater();
// account info?
uoSocket->log( tr( "Client '%1' disconnected from gameserver.\n" ).arg( uoSocket->ip()) );
}
// Load IP Blocking rules
void cNetwork::load()
{
if ( Config::instance()->enableLogin() )
{
d->loginServer_ = new QTcpServer( this );
if ( !d->loginServer_->listen( QHostAddress::Any, Config::instance()->loginPort() ) )
throw wpException( tr("Unable to listen to port %1, port may be already in use").arg(Config::instance()->loginPort()) );
connect( d->loginServer_, SIGNAL(newConnection()), this, SLOT(incomingLoginServerConnection()));
Console::instance()->send( tr( "\nLoginServer running on port %1\n" ).arg( Config::instance()->loginPort() ) );
QList<ServerList_st> serverList = Config::instance()->serverList();
if ( serverList.size() < 1 )
Console::instance()->log( LOG_WARNING, tr( "LoginServer enabled but there no Game server entries found\n Check your wolfpack.xml settings\n" ) );
else
{
for ( QList<ServerList_st>::iterator it = serverList.begin(); it != serverList.end(); ++it )
Console::instance()->send( tr("\t%1 using address %2\n").arg( (*it).sServer, (*it).address.toString() ) );
}
}
if ( Config::instance()->enableGame() )
{
d->gameServer_ = new QTcpServer( this );
if ( !d->gameServer_->listen( QHostAddress::Any, Config::instance()->gamePort() ) )
throw wpException( tr("Unable to listen to port %1, port may be already in use").arg(Config::instance()->gamePort()) );
connect( d->gameServer_, SIGNAL(newConnection()), this, SLOT(incomingGameServerConnection()));
Console::instance()->send( tr( "\nGameServer running on port %1\n" ).arg( Config::instance()->gamePort() ) );
}
cComponent::load();
}
// Reload IP Blocking rules
void cNetwork::reload()
{
unload();
load();
}
// Unload IP Blocking rules
void cNetwork::unload()
{
// Disconnect all connected sockets
QList<cUOSocket*> socketList = d->uoSockets;
d->uoSockets.clear();
foreach (cUOSocket *socket, socketList)
{
socket->disconnect();
delete socket;
}
socketList = d->loginSockets;
d->loginSockets.clear();
foreach (cUOSocket *socket, d->loginSockets)
{
socket->disconnect();
delete socket;
}
// Process derrefered deletion of cUOSockets before deleting the parent QTcpSocket to avoid double deletion.
QCoreApplication::processEvents();
if ( d->loginServer_ )
{
delete d->loginServer_;
d->loginServer_ = 0;
}
if ( d->gameServer_ )
{
delete d->gameServer_;
d->gameServer_ = 0;
}
cComponent::unload();
}
void cNetwork::lock()
{
d->mutex.lock();
}
void cNetwork::unlock()
{
d->mutex.unlock();
}
quint32 cNetwork::count()
{
return d->uoSockets.count();
}
QListIterator<cUOSocket*> cNetwork::getIterator()
{
return QListIterator<cUOSocket*>( d->uoSockets );
}
QList<cUOSocket*> cNetwork::sockets() const
{
return d->uoSockets;
}
void cNetwork::broadcast( const QString& message, quint16 color, quint16 font )
{
foreach ( cUOSocket* socket, d->uoSockets )
{
socket->sysMessage( message, color, font );
}
}
| [
"naddel@db57ef4e-4fe8-0310-84ee-c23f6f2f8b61"
] | naddel@db57ef4e-4fe8-0310-84ee-c23f6f2f8b61 |
e7e1f2dccf013e7b1d65bdf0f3c45309ff083e55 | 036b638da689f7a86a761f6731a9215e5e57a265 | /mainwindow.h | 70904eda0036e6c856d7ddd3c5edf46eede4ecab | [] | no_license | TomaszGlowacki/QTHashChecker | 51f6dbf25f80f93c9eb9acb53172617f04ffed63 | 22e5fb68591c4220307719ecc4aae1a52daf3519 | refs/heads/master | 2020-04-04T21:52:13.509466 | 2018-11-06T00:16:00 | 2018-11-06T00:16:00 | 156,301,159 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,527 | h | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QWidget>
#include <QPushButton>
#include <QProgressBar>
#include <QTabBar>
#include <QMessageBox>
#include <QTextEdit>
#include <QLabel>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
private:
Ui::MainWindow *ui;
QPushButton *CreateFilesButton;
QPushButton *CheckFilesButton;
QLabel *LabeltoNumberOfFiles;
QTextEdit *NumberOfFiles;
QLabel *LabeltoPathToFiles;
QTextEdit *PathToFiles;
QLabel *LabeltoPasword;
QTextEdit *Password;
QLabel *LabeltoSecretText;
QTextEdit *SecretText;
QLabel *ProgressLabel;
QProgressBar *progressBar;
volatile int value;
void CreateSingleFile(QString name, int number);
void WorkDone();
QString encrypt(QString password, QString time);
void UpdateProgressBar(int count);
void CreateFileIfMatched( QString text, int number );
QString CheckHash(QString hash, QString datetime, QString number);
QString Generate( int length, QString s, QString Datetime, QString hash, QString number);
bool fileExists(QString path);
// no time for those, need more 2-4 days to implement for each.
void CheckWithOpenCL();
void CheckWIthCuda();
public slots:
void CreateFilesButtonClicked();
void CheckFilesButtonClicked();
public:
MainWindow(QWidget *parent = 0);
MainWindow(QWidget *parent, Ui::MainWindow *lui);
virtual ~MainWindow();
};
#endif // MAINWINDOW_H
| [
"tomasz.k.glowacki@gmail.com"
] | tomasz.k.glowacki@gmail.com |
86b862cf7ca83ba12c96e60acd9f6dd6617ff746 | 0f2b08b31fab269c77d4b14240b8746a3ba17d5e | /onnxruntime/core/framework/onnxruntime_sequence_type_info.h | 981a7c7485cca28fdc29ef310048cc87aecbab93 | [
"MIT"
] | permissive | microsoft/onnxruntime | f75aa499496f4d0a07ab68ffa589d06f83b7db1d | 5e747071be882efd6b54d7a7421042e68dcd6aff | refs/heads/main | 2023-09-04T03:14:50.888927 | 2023-09-02T07:16:28 | 2023-09-02T07:16:28 | 156,939,672 | 9,912 | 2,451 | MIT | 2023-09-14T21:22:46 | 2018-11-10T02:22:53 | C++ | UTF-8 | C++ | false | false | 729 | h | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once
#include <memory>
#include "core/framework/onnxruntime_typeinfo.h"
namespace ONNX_NAMESPACE {
class TypeProto;
}
struct OrtSequenceTypeInfo {
public:
explicit OrtSequenceTypeInfo(std::unique_ptr<OrtTypeInfo> sequence_key_type) noexcept;
~OrtSequenceTypeInfo();
std::unique_ptr<OrtTypeInfo> sequence_key_type_;
std::unique_ptr<OrtSequenceTypeInfo> Clone() const;
static std::unique_ptr<OrtSequenceTypeInfo> FromTypeProto(const ONNX_NAMESPACE::TypeProto&);
OrtSequenceTypeInfo(const OrtSequenceTypeInfo& other) = delete;
OrtSequenceTypeInfo& operator=(const OrtSequenceTypeInfo& other) = delete;
};
| [
"noreply@github.com"
] | noreply@github.com |
b69958d70a94124dee63a83d69580228f3c5841b | 715cfa11de952cc8baf42d52c63823bbd3d2f878 | /PCF-CuboidMatrixWall-Cuboid/CWbMTE-Alpha-0.1l/src/css/Map.h | 45370fcefab68d51d619e70da68a5e17802a5282 | [] | no_license | Drwalin/PCF_Engine | f513fa9daf3c0bb96e6931b6460deb15abf4f195 | 43814c983e40bb2f5a6544875c1f75dbff701eae | refs/heads/master | 2021-09-04T11:47:09.441634 | 2018-01-18T11:36:28 | 2018-01-18T11:36:28 | 117,959,850 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,294 | h |
class Map
{
public:
vector < Texture > texture;
vector < GraphicModel > model;
vector < TrianglePX > triPHYS;
vector < TriangleGX > triTEXT;
vector < TriangleSTGX > triSTRIP;
vector < VBOtextured > vbotex;
vector < VBOcollored > vbocol;
PointParticle particles;
vector < PhysicModelStatic > staticobject;
//vector < PhisicModel > orientatedobject;
////OperateParticles ParticlesSystem;
int CameraObject;
float Gravity;
float AirResistance;
unsigned int maxiumumnumberoftrianglescolliders[2];
unsigned int maxiumumnumberofobjectcolliders[2];
ColliderTerrain ** colliderter;
//ColliderTerrain colliderter[32][32];
ColliderObjects ** colliderobj;
float moveColliderTerrain[2];
float moveColliderObject[2];
float sizeColliderTerrain[2];
float sizeColliderObject[2];
inline void UpdateForces( float FrameTime );
inline void UpdateObjectsCollisions( float FrameTime, int begin, int end );
//inline void UpdateObjects( float FrameTime );
inline void UpdateObjectColliders();
inline void UpdateTerrainColliders();
inline void Update( float FrameTime );
inline void Draw();
inline int SegmentCollision( Vector p1, Vector p2, PhysicModelStatic ** object, TrianglePX ** triangle );
Map();
~Map();
};
| [
"garekmarek@wp.pl"
] | garekmarek@wp.pl |
d3491a8d38efd4d1d8bf2941d7a1591041459dc7 | 8e33f5d04babcb7faf03bf3dc4ba8c3c6931fb3d | /pwm_example/src/pwm_publisher.cpp | 6a0993a81920d960b5e45ca89ba7409bad096455 | [] | no_license | jeffrey870517/neuron_library_example | db1ea843e544dab1ace8e558fff3e4558a6c25f7 | 81e43beb39d4d336b6ba527d4925fc987cd7dc0d | refs/heads/master | 2023-03-01T19:07:36.341127 | 2020-12-03T08:27:48 | 2020-12-03T08:27:48 | 281,559,808 | 0 | 0 | null | 2020-07-22T03:00:16 | 2020-07-22T03:00:15 | null | UTF-8 | C++ | false | false | 1,400 | cpp | #include <chrono>
#include <memory>
#include<ctype.h>
#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/float64_multi_array.hpp"
using namespace std::chrono_literals;
double period_msg;
double duty_cycle_msg;
class PWMPublisher : public rclcpp::Node
{
public:
PWMPublisher()
: Node("pwm_publisher")
{
publisher_ = this->create_publisher<std_msgs::msg::Float64MultiArray>("pwm_control_msg", 10 );
timer_ = this->create_wall_timer(
1000ms, std::bind(&PWMPublisher::timer_callback, this));
}
private:
void timer_callback()
{
auto message = std_msgs::msg::Float64MultiArray();
message.data.resize(2);
message.data[0] = period_msg;
message.data[1] = duty_cycle_msg/100;
RCLCPP_INFO(this->get_logger(), "Publishing: Period = %lf, Duty Cycle = %lf", message.data[0],message.data[1]);
publisher_->publish(message);
}
rclcpp::TimerBase::SharedPtr timer_;
rclcpp::Publisher<std_msgs::msg::Float64MultiArray>::SharedPtr publisher_;
};
int main(int argc, char * argv[])
{
rclcpp::init(argc, argv);
if (argc!=3||isalpha(*argv[1])||isalpha(*argv[2]))
{
std::cout << "Usage: ros2 run nsdk_example_pwm pwm_publisher <Period of PWM> <Duty Cycle(in percentage)>" << std::endl;;
return 0;
}
period_msg = atof(argv[1]);
duty_cycle_msg = atof(argv[2]);
rclcpp::spin(std::make_shared<PWMPublisher>());
rclcpp::shutdown();
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
651bcea73d6775fdf015cab6028315d62075e9b1 | 120b126bf03cbf575731907017217101cf89220f | /d04/ex01/Enemy.hpp | 7cec609a53b404822964db1b8eb96a20b0f13bd6 | [] | no_license | YahyaOukharta/Piscine-Cpp | 77cea1d1473b1ab86ed5668a7d022af08a6ef30d | 071cc275197ae253d539ec1a4c406af75fd1246e | refs/heads/master | 2023-07-26T20:35:12.925099 | 2021-09-11T17:25:20 | 2021-09-11T17:25:20 | 316,840,694 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 368 | hpp | #ifndef __ENEMY_HPP__
# define __ENEMY_HPP__
# include <string>
class Enemy
{
protected :
int hit_points;
std::string const &type;
public :
Enemy(int hp, std::string const &type);
virtual ~Enemy();
std::string const &getType() const;
int getHP() const;
virtual void takeDamage(int amount);
};
#endif | [
"youkhart@e0r2p2.1337.ma"
] | youkhart@e0r2p2.1337.ma |
d9df103134fd7c9ce660933a70cd2acea6a61d65 | f50da5dfb1d27cf737825705ce5e286bde578820 | /Temp/il2cppOutput/il2cppOutput/System_Xml_Mono_Xml2_XmlTextReader_XmlTokenInfo2571680784.h | 13a7676188e46a5c56126e07b68952de43cc48e7 | [] | no_license | magonicolas/OXpecker | 03f0ea81d0dedd030d892bfa2afa4e787e855f70 | f08475118dc8f29fc9c89aafea5628ab20c173f7 | refs/heads/master | 2020-07-05T11:07:21.694986 | 2016-09-12T16:20:33 | 2016-09-12T16:20:33 | 67,150,904 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,050 | h | #pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
// System.String
struct String_t;
// Mono.Xml2.XmlTextReader
struct XmlTextReader_t3066586409;
#include "mscorlib_System_Object837106420.h"
#include "System_Xml_System_Xml_XmlNodeType3966624571.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// Mono.Xml2.XmlTextReader/XmlTokenInfo
struct XmlTokenInfo_t2571680784 : public Il2CppObject
{
public:
// System.String Mono.Xml2.XmlTextReader/XmlTokenInfo::valueCache
String_t* ___valueCache_0;
// Mono.Xml2.XmlTextReader Mono.Xml2.XmlTextReader/XmlTokenInfo::Reader
XmlTextReader_t3066586409 * ___Reader_1;
// System.String Mono.Xml2.XmlTextReader/XmlTokenInfo::Name
String_t* ___Name_2;
// System.String Mono.Xml2.XmlTextReader/XmlTokenInfo::LocalName
String_t* ___LocalName_3;
// System.String Mono.Xml2.XmlTextReader/XmlTokenInfo::Prefix
String_t* ___Prefix_4;
// System.String Mono.Xml2.XmlTextReader/XmlTokenInfo::NamespaceURI
String_t* ___NamespaceURI_5;
// System.Boolean Mono.Xml2.XmlTextReader/XmlTokenInfo::IsEmptyElement
bool ___IsEmptyElement_6;
// System.Char Mono.Xml2.XmlTextReader/XmlTokenInfo::QuoteChar
uint16_t ___QuoteChar_7;
// System.Int32 Mono.Xml2.XmlTextReader/XmlTokenInfo::LineNumber
int32_t ___LineNumber_8;
// System.Int32 Mono.Xml2.XmlTextReader/XmlTokenInfo::LinePosition
int32_t ___LinePosition_9;
// System.Int32 Mono.Xml2.XmlTextReader/XmlTokenInfo::ValueBufferStart
int32_t ___ValueBufferStart_10;
// System.Int32 Mono.Xml2.XmlTextReader/XmlTokenInfo::ValueBufferEnd
int32_t ___ValueBufferEnd_11;
// System.Xml.XmlNodeType Mono.Xml2.XmlTextReader/XmlTokenInfo::NodeType
int32_t ___NodeType_12;
public:
inline static int32_t get_offset_of_valueCache_0() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___valueCache_0)); }
inline String_t* get_valueCache_0() const { return ___valueCache_0; }
inline String_t** get_address_of_valueCache_0() { return &___valueCache_0; }
inline void set_valueCache_0(String_t* value)
{
___valueCache_0 = value;
Il2CppCodeGenWriteBarrier(&___valueCache_0, value);
}
inline static int32_t get_offset_of_Reader_1() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___Reader_1)); }
inline XmlTextReader_t3066586409 * get_Reader_1() const { return ___Reader_1; }
inline XmlTextReader_t3066586409 ** get_address_of_Reader_1() { return &___Reader_1; }
inline void set_Reader_1(XmlTextReader_t3066586409 * value)
{
___Reader_1 = value;
Il2CppCodeGenWriteBarrier(&___Reader_1, value);
}
inline static int32_t get_offset_of_Name_2() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___Name_2)); }
inline String_t* get_Name_2() const { return ___Name_2; }
inline String_t** get_address_of_Name_2() { return &___Name_2; }
inline void set_Name_2(String_t* value)
{
___Name_2 = value;
Il2CppCodeGenWriteBarrier(&___Name_2, value);
}
inline static int32_t get_offset_of_LocalName_3() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___LocalName_3)); }
inline String_t* get_LocalName_3() const { return ___LocalName_3; }
inline String_t** get_address_of_LocalName_3() { return &___LocalName_3; }
inline void set_LocalName_3(String_t* value)
{
___LocalName_3 = value;
Il2CppCodeGenWriteBarrier(&___LocalName_3, value);
}
inline static int32_t get_offset_of_Prefix_4() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___Prefix_4)); }
inline String_t* get_Prefix_4() const { return ___Prefix_4; }
inline String_t** get_address_of_Prefix_4() { return &___Prefix_4; }
inline void set_Prefix_4(String_t* value)
{
___Prefix_4 = value;
Il2CppCodeGenWriteBarrier(&___Prefix_4, value);
}
inline static int32_t get_offset_of_NamespaceURI_5() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___NamespaceURI_5)); }
inline String_t* get_NamespaceURI_5() const { return ___NamespaceURI_5; }
inline String_t** get_address_of_NamespaceURI_5() { return &___NamespaceURI_5; }
inline void set_NamespaceURI_5(String_t* value)
{
___NamespaceURI_5 = value;
Il2CppCodeGenWriteBarrier(&___NamespaceURI_5, value);
}
inline static int32_t get_offset_of_IsEmptyElement_6() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___IsEmptyElement_6)); }
inline bool get_IsEmptyElement_6() const { return ___IsEmptyElement_6; }
inline bool* get_address_of_IsEmptyElement_6() { return &___IsEmptyElement_6; }
inline void set_IsEmptyElement_6(bool value)
{
___IsEmptyElement_6 = value;
}
inline static int32_t get_offset_of_QuoteChar_7() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___QuoteChar_7)); }
inline uint16_t get_QuoteChar_7() const { return ___QuoteChar_7; }
inline uint16_t* get_address_of_QuoteChar_7() { return &___QuoteChar_7; }
inline void set_QuoteChar_7(uint16_t value)
{
___QuoteChar_7 = value;
}
inline static int32_t get_offset_of_LineNumber_8() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___LineNumber_8)); }
inline int32_t get_LineNumber_8() const { return ___LineNumber_8; }
inline int32_t* get_address_of_LineNumber_8() { return &___LineNumber_8; }
inline void set_LineNumber_8(int32_t value)
{
___LineNumber_8 = value;
}
inline static int32_t get_offset_of_LinePosition_9() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___LinePosition_9)); }
inline int32_t get_LinePosition_9() const { return ___LinePosition_9; }
inline int32_t* get_address_of_LinePosition_9() { return &___LinePosition_9; }
inline void set_LinePosition_9(int32_t value)
{
___LinePosition_9 = value;
}
inline static int32_t get_offset_of_ValueBufferStart_10() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___ValueBufferStart_10)); }
inline int32_t get_ValueBufferStart_10() const { return ___ValueBufferStart_10; }
inline int32_t* get_address_of_ValueBufferStart_10() { return &___ValueBufferStart_10; }
inline void set_ValueBufferStart_10(int32_t value)
{
___ValueBufferStart_10 = value;
}
inline static int32_t get_offset_of_ValueBufferEnd_11() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___ValueBufferEnd_11)); }
inline int32_t get_ValueBufferEnd_11() const { return ___ValueBufferEnd_11; }
inline int32_t* get_address_of_ValueBufferEnd_11() { return &___ValueBufferEnd_11; }
inline void set_ValueBufferEnd_11(int32_t value)
{
___ValueBufferEnd_11 = value;
}
inline static int32_t get_offset_of_NodeType_12() { return static_cast<int32_t>(offsetof(XmlTokenInfo_t2571680784, ___NodeType_12)); }
inline int32_t get_NodeType_12() const { return ___NodeType_12; }
inline int32_t* get_address_of_NodeType_12() { return &___NodeType_12; }
inline void set_NodeType_12(int32_t value)
{
___NodeType_12 = value;
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| [
"magonicolas@gmail.com"
] | magonicolas@gmail.com |
7ede940204a792b2b454e7a7839958ba696dfa65 | 758047399f04919b3ac44f08d9f1e4a89dc9a3e7 | /22/main.cpp | e3fcb48d017b88ca33bf51952cb2e2675006942e | [
"MIT"
] | permissive | svenzhang2016/myeular | e949bc5e11bba9257254ae7732508fc6b14561fb | 0573214965d98a864d794b756f09fa75d08c7640 | refs/heads/master | 2021-10-09T13:36:06.094115 | 2021-10-07T05:22:28 | 2021-10-07T05:22:28 | 151,822,301 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,055 | cpp | /*
Using names.txt (right click and 'Save Link/Target As...'), a 46K text file
containing over five-thousand first names, begin by sorting it into alphabetical
order. Then working out the alphabetical value for each name, multiply this
value by its alphabetical position in the list to obtain a name score.
For example, when the list is sorted into alphabetical order, COLIN, which is
worth 3 + 15 + 12 + 9 + 14 = 53, is the 938th name in the list. So, COLIN would
obtain a score of 938 × 53 = 49714.
What is the total of all the name scores in the file?
*/
#include <algorithm>
#include <cassert>
#include <fstream>
#include <iostream>
#include <regex>
#include <sstream>
#include <string>
using namespace std;
void split_ref(const string &s, vector<string> &tokens,
const string &delims = " ") {
string::size_type lastPos = s.find_first_not_of(delims, 0);
string::size_type pos = s.find_first_of(delims, lastPos);
while (string::npos != pos || string::npos != lastPos) {
tokens.push_back(s.substr(lastPos, pos - lastPos));
lastPos = s.find_first_not_of(delims, pos);
pos = s.find_first_of(delims, lastPos);
}
}
std::vector<std::string> split(const std::string &str,
const std::string &delims = " ") {
std::vector<std::string> output;
auto first = std::cbegin(str);
while (first != std::cend(str)) {
const auto second = std::find_first_of(
first, std::cend(str), std::cbegin(delims), std::cend(delims));
if (first != second)
output.emplace_back(first, second);
if (second == std::cend(str))
break;
first = std::next(second);
}
return output;
}
std::vector<std::string_view> splitSV(std::string_view strv,
std::string_view delims = " ") {
std::vector<std::string_view> output;
size_t first = 0;
while (first < strv.size()) {
const auto second = strv.find_first_of(delims, first);
if (first != second)
output.emplace_back(strv.substr(first, second - first));
if (second == std::string_view::npos)
break;
first = second + 1;
}
return output;
}
// 归并排序
void merge(vector<string> &tokens, int left, int mid, int right) {
vector<string> help(right - left + 1);
int p1 = left, p2 = mid + 1, i = 0;
while (p1 <= mid && p2 <= right) {
help[i++] = tokens[p1] > tokens[p2] ? tokens[p2++] : tokens[p1++];
}
while (p1 <= mid) {
help[i++] = tokens[p1++];
}
while (p2 <= right) {
help[i++] = tokens[p2++];
}
for (int i = 0; i < right - left + 1; i++) {
tokens[left + i] = help[i];
}
}
void sorting(vector<string> &tokens, int left, int right) {
if (left < right) {
int mid = left + ((right - left) >> 1); //(left+right)/2
sorting(tokens, left, mid);
sorting(tokens, mid + 1, right);
merge(tokens, left, mid, right);
}
}
void mergeSort(vector<string> &tokens) {
if (tokens.size() < 2)
return;
int left = 0, right = tokens.size() - 1;
sorting(tokens, left, right);
}
int sumOneString(const string &val) {
int sum = 0;
return sum;
}
int main() {
ifstream in("F:/gitrepos/svenzhang2016/myeular/22/p022_names.txt");
assert(in.is_open());
// int length;
// in.seekg(0, std::ios::end);
// length = in.tellg();
// in.seekg(0, std::ios::end);
// char *buffer = new char[length];
// in.read(buffer, length);
// in.close();
// stringstream buffer;
// buffer << in.rdbuf();
// string str(buffer.str());
string str((istreambuf_iterator<char>(in)), istreambuf_iterator<char>());
vector<string> tokens;
split_ref(str, tokens, ",");
// mergeSort(tokens);
sort(tokens.begin(), tokens.end());
long long int sum = 0;
for (size_t i = 0; i < tokens.size(); ++i) {
sum += (i + 1) * sumOneString(tokens[i]);
}
std::cout << "sum: " << sum;
} | [
"qqwowo2011@outlook.com"
] | qqwowo2011@outlook.com |
637c0e208343f93e6e98b39f415eeaf1fb4fa10c | 48e255bc927dc4a67ce7a4a7efa95b21414a7e9d | /cases/impingingJets/constant/transportProperties | dfe29f49c2fd143490200370605552240f0e55da | [] | no_license | TsukasaHori/dropletFoam | 472427a78feb82617364ff6baec6e4d1ccb47431 | 3d8a85037c94ab2a56b7f8329d7395833f261928 | refs/heads/master | 2020-07-16T14:33:22.213795 | 2019-09-03T07:33:30 | 2019-09-03T07:33:30 | 205,806,155 | 0 | 0 | null | 2019-09-02T08:00:11 | 2019-09-02T08:00:11 | null | UTF-8 | C++ | false | false | 873 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //
| [
"tyler.voskuilen@gmail.com"
] | tyler.voskuilen@gmail.com | |
07697387f9e9e98faec51096903763a1db8dde58 | 90e448cac3c2cea5d03706152c08a7b14598c6ad | /lib/child.cpp | b862c52b1f6d1c98ddb21174d8579301f2130809 | [] | no_license | xingangshi/swig_for_py3 | 1471565bcf6d18f2dca28402d060cc4ad063b68b | 7227a5aba5cae5c1aeaa41cbc71436a0e04801b2 | refs/heads/master | 2022-06-22T13:36:39.359699 | 2020-05-09T02:06:45 | 2020-05-09T02:06:45 | 261,986,097 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 307 | cpp | #include "child.hpp"
child::child(double size_of_head):
m_size_of_head(size_of_head)
{}
uint8_t child::get_number_of_legs() const
{
return 2;
}
double child::get_size_of_head() const
{
return m_size_of_head;
}
void child::set_size_of_head(double size_of_head)
{
m_size_of_head = size_of_head;
}
| [
"shix_112@163.com"
] | shix_112@163.com |
5288be2c6c8cb85040e64ed92732e30e37c7680c | 1ee1076ac970d18409faac4aca10bff1e3128b59 | /source/components/postfx/comp_render_outlines.cpp | 0d4b18603456094edeb7f5bafc63fc1925e4e2cd | [] | no_license | albertoamo/Atlas-Fate-Between-Light-and-Darkness | ae225663138312ceff90e51a41dc5008e66a07d2 | 54a87218ff271ed276cbae5f55c215ebb0eec376 | refs/heads/master | 2021-09-27T01:54:25.196035 | 2018-11-05T01:13:53 | 2018-11-05T01:13:53 | 156,142,666 | 4 | 0 | null | 2018-11-05T01:18:50 | 2018-11-05T01:18:49 | null | UTF-8 | C++ | false | false | 2,353 | cpp | #include "mcv_platform.h"
#include "comp_render_outlines.h"
#include "render/texture/render_to_texture.h"
#include "resources/resources_manager.h"
#include "render/render_objects.h"
extern ID3D11ShaderResourceView* depth_shader_resource_view;
DECL_OBJ_MANAGER("render_outlines", TCompRenderOutlines);
CRenderToTexture* TCompRenderOutlines::post_rt = nullptr;
// ---------------------
void TCompRenderOutlines::debugInMenu() {
ImGui::Checkbox("Enabled", &enabled);
ImGui::DragFloat("Amount", &amount, 0.01f, 0.0f, 1.0f);
}
void TCompRenderOutlines::load(const json& j, TEntityParseContext& ctx) {
enabled = j.value("enabled", true);
amount = j.value("amount", 1.0f);
int xres = Render.width;
int yres = Render.height;
if (!post_rt) {
post_rt = new CRenderToTexture;
// Create a unique name for the rt
char rt_name[64];
sprintf(rt_name, "Fog_%08x", CHandle(this).asUnsigned());
bool is_ok = post_rt->createRT(rt_name, xres, yres, DXGI_FORMAT_B8G8R8A8_UNORM);
assert(is_ok);
}
tech = Resources.get("outlines.tech")->as<CRenderTechnique>();
post_tech = Resources.get("postfx_scanner.tech")->as<CRenderTechnique>();
mesh = Resources.get("unit_quad_xy.mesh")->as<CRenderMesh>();
}
CTexture* TCompRenderOutlines::apply(CTexture* in_texture) {
if (!enabled)
return in_texture;
CTraceScoped scope("TCompRenderOutlines");
// Upload to the GPU the how much visibe is the effect (defaults to 100%)
cb_globals.global_shared_fx_amount = amount;
cb_globals.updateGPU();
// Disable the ZBuffer
CRenderToTexture* rt = CRenderToTexture::getCurrentRT();
ID3D11RenderTargetView* rtv = rt->getRenderTargetView();
Render.ctx->OMSetRenderTargets(1, &rtv, nullptr);
// Activate the depth stencil buffer as texture 0
Render.ctx->PSSetShaderResources(TS_ALBEDO, 1, &Render.depth_shader_resource_view);
tech->activate();
mesh->activateAndRender();
// Restore the current render target as it was
CTexture::setNullTexture(TS_ALBEDO);
//rt->activateRT();
// Compute the fullscreen post process shockwave
post_rt->activateRT();
in_texture->activate(TS_ALBEDO);
//in_outline_albedo->activate(TS_EMISSIVE);
post_tech->activate();
mesh->activateAndRender();
return post_rt;
} | [
"alberto93.dev@gmail.com"
] | alberto93.dev@gmail.com |
a941a33a18ff51afe4f94e9150e2d123c990aac5 | 0173b8aecfbdc53fc1a63db591e5d70027960d65 | /arithmetics/MultiplicationAlg.h | 2551df412c188f0338e5598532712ba865a7f087 | [] | no_license | pbilinskyi/university-algorithms-on-c- | 702a0a54310af7fa418055289ebad4441489fbdd | 11f49c84c9d0fb994ab9885e255e5e7d2eda3970 | refs/heads/master | 2023-04-12T22:12:56.804414 | 2020-11-10T13:34:19 | 2020-11-10T13:34:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 160 | h | #pragma once
#include "BigInteger.h"
class MultiplicationAlg {
public:
virtual BigInteger multiply(BigInteger const& i1, BigInteger const& i2) = 0;
};
| [
"ibilinskij@gmail.com"
] | ibilinskij@gmail.com |
5241dc80feeb5d3701b5c24d2500772141ae9764 | b571a0ae02b7275b52499c66a756d10815136326 | /0987.Vertical.Order.Traversal.of.a.Binary.Tree/sol.cpp | 117dd08d3a6009c1e8559eaa047116eb2342dc76 | [] | no_license | xjs-js/leetcode | 386f9acf89f7e69b5370fdeffa9e5120cf57f868 | ef7601cbac1a64339e519d263604f046c747eda8 | refs/heads/master | 2022-02-02T00:51:23.798702 | 2022-01-19T14:48:13 | 2022-01-19T14:48:13 | 89,140,244 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,839 | cpp | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
private:
map<TreeNode*, pair<int, int>> _memo;
map<int, vector<int>> _relt;
public:
vector<vector<int>> verticalTraversal(TreeNode* root) {
queue<TreeNode*> que;
que.push(root);
_memo.insert({root, {0, 0}});
while (!que.empty()) {
int s = que.size();
map<int, vector<int>> cur;
while (s--) {
TreeNode* front = que.front();
que.pop();
auto p = _memo.at(front);
cur[p.second].push_back(front->val);
if (front->left) {
_memo.insert({front->left, {p.first+1, p.second-1}});
que.push(front->left);
}
if (front->right) {
_memo.insert({front->right, {p.first+1, p.second+1}});
que.push(front->right);
}
}
auto it = cur.begin();
while (it != cur.end()) {
int col = it->first;
auto& arr = it->second;
sort(arr.begin(), arr.end());
for (int i = 0; i < arr.size(); ++i) {
_relt[col].push_back(arr[i]);
}
++it;
}
}
vector<vector<int>> ans;
auto it = _relt.begin();
while (it != _relt.end()) {
ans.push_back(it->second);
++it;
}
return ans;
}
};
| [
"xjs.js@outlook.com"
] | xjs.js@outlook.com |
071632e49e08b7ed2118c140259547ab12bd3b94 | 8367c719a14af007dfd974191a0fb3814c5523e0 | /smtk/extension/vtk/io/ReadVTKData.cxx | 463d7953cc5c3ca334e2f6a96191c1b1af90e314 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | praveenmunagapati/SMTK | 3b0fafe3e451dcd16d4ac11d5476d3a4c15f5e4b | 8059c8023f1c4281c2437fc07e9278e3c2c9cbdf | refs/heads/master | 2021-07-22T14:49:36.214465 | 2017-11-05T19:24:59 | 2017-11-05T19:25:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,011 | cxx | //=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
//=============================================================================
#include "smtk/extension/vtk/io/ReadVTKData.h"
#include "smtk/common/Paths.h"
#include "smtk/extension/vtk/filter/vtkImageSpacingFlip.h"
#include "smtk/extension/vtk/reader/vtkCMBGeometryReader.h"
#include "smtk/extension/vtk/reader/vtkLASReader.h"
#include "vtkAppendPoints.h"
#include "vtkCellArray.h"
#include "vtkCellData.h"
#include "vtkCompositeDataSet.h"
#include "vtkDataObject.h"
#include "vtkDataObjectTreeIterator.h"
#include "vtkDataSet.h"
#include "vtkDoubleArray.h"
#include "vtkGDALRasterReader.h"
#include "vtkGraph.h"
#include "vtkIdTypeArray.h"
#include "vtkImageData.h"
#include "vtkImageMapToColors.h"
#include "vtkInformation.h"
#include "vtkInformationStringKey.h"
#include "vtkInformationVector.h"
#include "vtkLookupTable.h"
#include "vtkMultiBlockDataSet.h"
#include "vtkNew.h"
#include "vtkOBJReader.h"
#include "vtkObjectFactory.h"
#include "vtkPLYReader.h"
#include "vtkPNGReader.h"
#include "vtkPTSReader.h"
#include "vtkPointData.h"
#include "vtkPoints.h"
#include "vtkPolyData.h"
#include "vtkPolyDataNormals.h"
#include "vtkProperty.h"
#include "vtkStringArray.h"
#include "vtkUnstructuredGrid.h"
#include "vtkXMLImageDataReader.h"
#include "vtkXMLMultiBlockDataReader.h"
#include "vtkXMLPolyDataReader.h"
#include "vtkXMLUnstructuredGridReader.h"
namespace smtk
{
namespace extension
{
namespace vtk
{
namespace io
{
ReadVTKData::~ReadVTKData()
{
}
bool ReadVTKData::valid(const std::string& file) const
{
std::string fileType = smtk::common::Paths::extension(file);
// If the file type isn't the empty string, remove the leading ".".
if (fileType.begin() != fileType.end() && fileType[0] == '.')
{
fileType.erase(fileType.begin());
}
return this->valid(std::make_pair(fileType, file));
}
vtkSmartPointer<vtkDataObject> ReadVTKData::operator()(const std::string& file)
{
std::string fileType = smtk::common::Paths::extension(file);
// If the file type isn't the empty string, remove the leading ".".
if (fileType.begin() != fileType.end() && fileType[0] == '.')
{
fileType.erase(fileType.begin());
}
return this->operator()(std::make_pair(fileType, file));
}
}
}
}
}
namespace
{
/// Reader types for each VTK file type that SMTK supports.
#define DeclareReader_type(FTYPE) \
class ReadVTKData_##FTYPE \
: public smtk::common::GeneratorType<std::pair<std::string, std::string>, \
vtkSmartPointer<vtkDataObject>, ReadVTKData_##FTYPE> \
{ \
public: \
bool valid(const std::pair<std::string, std::string>& fileInfo) const override; \
\
vtkSmartPointer<vtkDataObject> operator()( \
const std::pair<std::string, std::string>& fileInfo) override; \
}; \
static bool registered_##FTYPE = ReadVTKData_##FTYPE::registerClass()
DeclareReader_type(vtp);
DeclareReader_type(vtu);
DeclareReader_type(vti);
DeclareReader_type(vtm);
DeclareReader_type(obj);
DeclareReader_type(ply);
DeclareReader_type(pts);
DeclareReader_type(tif);
DeclareReader_type(png);
DeclareReader_type(cmb);
DeclareReader_type(las);
#undef DeclareReader_type
#define BasicReader_type(FTYPE, CLASS, READER) \
bool ReadVTKData_##FTYPE::valid(const std::pair<std::string, std::string>& fileInfo) const \
{ \
return fileInfo.first == #FTYPE; \
} \
\
vtkSmartPointer<vtkDataObject> ReadVTKData_##FTYPE::operator()( \
const std::pair<std::string, std::string>& fileInfo) \
{ \
vtkNew<READER> rdr; \
rdr->SetFileName(fileInfo.second.c_str()); \
rdr->Update(); \
\
vtkSmartPointer<CLASS> data = vtkSmartPointer<CLASS>::New(); \
data->ShallowCopy(rdr->GetOutput()); \
return data; \
}
/* clang-format off */
BasicReader_type(vtp, vtkPolyData, vtkXMLPolyDataReader)
BasicReader_type(vtu, vtkUnstructuredGrid, vtkXMLUnstructuredGridReader)
BasicReader_type(vti, vtkImageData, vtkXMLImageDataReader)
BasicReader_type(vtm, vtkMultiBlockDataSet, vtkXMLMultiBlockDataReader)
BasicReader_type(png, vtkImageData, vtkPNGReader)
#ifdef HELP_CLANG_FORMAT
;
#endif
/* clang-format on */
#undef BasicReader_type
bool ReadVTKData_obj::valid(const std::pair<std::string, std::string>& fileInfo) const
{
return fileInfo.first == "obj";
}
vtkSmartPointer<vtkDataObject> ReadVTKData_obj::operator()(
const std::pair<std::string, std::string>& fileInfo)
{
vtkNew<vtkOBJReader> rdr;
rdr->SetFileName(fileInfo.second.c_str());
rdr->Update();
vtkSmartPointer<vtkPolyData> data = vtkSmartPointer<vtkPolyData>::New();
data->ShallowCopy(rdr->GetOutput());
// If a data read prior to this call failed, the data passed to this method
// may be incomplete. So, we guard against bad data to prevent the subsequent
// logic from causing the program to crash.
if (data == nullptr || data->GetNumberOfPoints() == 0)
{
return data;
}
vtkNew<vtkDoubleArray> pointCoords;
pointCoords->ShallowCopy(data->GetPoints()->GetData());
pointCoords->SetName("PointCoordinates");
data->GetPointData()->AddArray(pointCoords.GetPointer());
return data;
}
bool ReadVTKData_ply::valid(const std::pair<std::string, std::string>& fileInfo) const
{
return fileInfo.first == "ply";
}
vtkSmartPointer<vtkDataObject> ReadVTKData_ply::operator()(
const std::pair<std::string, std::string>& fileInfo)
{
vtkNew<vtkPLYReader> rdr;
rdr->SetFileName(fileInfo.second.c_str());
rdr->Update();
vtkSmartPointer<vtkPolyData> data = vtkSmartPointer<vtkPolyData>::New();
data->ShallowCopy(rdr->GetOutput());
// If a data read prior to this call failed, the data passed to this method
// may be incomplete. So, we guard against bad data to prevent the subsequent
// logic from causing the program to crash.
if (data == nullptr || data->GetNumberOfPoints() == 0)
{
return data;
}
vtkNew<vtkDoubleArray> pointCoords;
pointCoords->ShallowCopy(data->GetPoints()->GetData());
pointCoords->SetName("PointCoordinates");
data->GetPointData()->AddArray(pointCoords.GetPointer());
return data;
}
bool ReadVTKData_pts::valid(const std::pair<std::string, std::string>& fileInfo) const
{
return fileInfo.first == "pts" || fileInfo.first == "xyz";
}
vtkSmartPointer<vtkDataObject> ReadVTKData_pts::operator()(
const std::pair<std::string, std::string>& fileInfo)
{
vtkNew<vtkPTSReader> rdr;
rdr->SetFileName(fileInfo.second.c_str());
rdr->Update();
vtkSmartPointer<vtkPolyData> data = vtkSmartPointer<vtkPolyData>::New();
data->ShallowCopy(rdr->GetOutput());
return data;
}
bool ReadVTKData_tif::valid(const std::pair<std::string, std::string>& fileInfo) const
{
return fileInfo.first == "tif" || fileInfo.first == "tiff" || fileInfo.first == "dem";
}
vtkSmartPointer<vtkDataObject> ReadVTKData_tif::operator()(
const std::pair<std::string, std::string>& fileInfo)
{
vtkNew<vtkGDALRasterReader> rdr;
rdr->SetFileName(fileInfo.second.c_str());
rdr->Update();
vtkSmartPointer<vtkImageData> outImage = vtkSmartPointer<vtkImageData>::New();
vtkSmartPointer<vtkImageData> data = vtkSmartPointer<vtkImageData>::New();
if (outImage.GetPointer())
{
// When dealing with indexed data into a color map, vtkGDALRasterReader
// creates a point data named "Categories" and associates to it the
// appropriate lookup table to convert to RGB space. We key off of the
// existence of this scalar data to convert our data from indices to RGB.
if (outImage->GetPointData() && outImage->GetPointData()->GetScalars() &&
strcmp(outImage->GetPointData()->GetScalars()->GetName(), "Categories") == 0)
{
vtkNew<vtkImageMapToColors> imageMapToColors;
imageMapToColors->SetInputData(outImage);
imageMapToColors->SetLookupTable(outImage->GetPointData()->GetScalars()->GetLookupTable());
imageMapToColors->Update();
outImage->ShallowCopy(imageMapToColors->GetOutput());
}
vtkNew<vtkImageSpacingFlip> flipImage;
flipImage->SetInputData(outImage);
flipImage->Update();
data->ShallowCopy(flipImage->GetOutput());
}
return data;
}
bool ReadVTKData_cmb::valid(const std::pair<std::string, std::string>& fileInfo) const
{
return (fileInfo.first == "bin" || fileInfo.first == "vtk" || fileInfo.first == "2dm" ||
fileInfo.first == "3dm" || fileInfo.first == "tin" || fileInfo.first == "poly" ||
fileInfo.first == "smesh" || fileInfo.first == "fac" || fileInfo.first == "sol" ||
fileInfo.first == "stl");
}
vtkSmartPointer<vtkDataObject> ReadVTKData_cmb::operator()(
const std::pair<std::string, std::string>& fileInfo)
{
vtkNew<vtkCMBGeometryReader> reader;
reader->SetFileName(fileInfo.second.c_str());
reader->SetPrepNonClosedSurfaceForModelCreation(false);
reader->SetEnablePostProcessMesh(false);
reader->Update();
auto polyOutput = vtkSmartPointer<vtkPolyData>::New();
polyOutput->ShallowCopy(reader->GetOutput());
return polyOutput;
}
bool ReadVTKData_las::valid(const std::pair<std::string, std::string>& fileInfo) const
{
return fileInfo.first == "las";
}
vtkSmartPointer<vtkDataObject> ReadVTKData_las::operator()(
const std::pair<std::string, std::string>& fileInfo)
{
vtkNew<vtkLASReader> reader;
reader->SetFileName(fileInfo.second.c_str());
reader->Update();
vtkMultiBlockDataSet* readout = reader->GetOutput();
vtkNew<vtkAppendPoints> appendPoints;
vtkCompositeDataIterator* iter = readout->NewIterator();
for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
{
vtkPolyData* blockPoly = vtkPolyData::SafeDownCast(iter->GetCurrentDataObject());
if (!blockPoly)
{
vtkGenericWarningMacro(<< "This block from LAS reader is not a polydata!\n");
continue;
}
appendPoints->AddInputData(blockPoly);
}
iter->Delete();
appendPoints->Update();
auto polyOutput = vtkSmartPointer<vtkPolyData>::New();
polyOutput->ShallowCopy(appendPoints->GetOutput());
return polyOutput;
}
}
| [
"tj.corona@kitware.com"
] | tj.corona@kitware.com |
6acc9fb689a0546f68fbbac24e581ec776ddc5bc | 361f078d17dad7648c09cdd8c6e4f0012933da1c | /endgame.cpp | 8aefbc9a5750d9f8e7032461f49ef28c2f28e789 | [] | no_license | abprice96/PlatformerFun | 5c91374ef5dd922ef21850ef7fdd98ce35466cc1 | 7fbbdff789c036cebb90da68b271944a0ce3ea7f | refs/heads/master | 2020-01-24T20:49:26.977673 | 2016-11-15T22:09:09 | 2016-11-15T22:09:09 | 73,858,783 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,475 | cpp | #include "endgame.h"
#include "ui_endgame.h"
#include "titlescreen.h"
#include "highscore.h"
#include "highscorepage.h"
#include "world.h"
#include <QRect>
EndGame::EndGame(QWidget *parent, bool gameOver_) :
QWidget(parent),
gameOver(gameOver_),
ui(new Ui::EndGame)
{
widgetParent = parent;
ui->setupUi(this);
if (!gameOver)
{
ui->PBcontinue->setEnabled(false);
ui->lblBonusText->setStyleSheet("QLabel {color : red; }");
bonusToAdd = World::instance().getSeconds();
bonusTimer = new QTimer(this);
bonusTimer->setInterval(30);
connect(bonusTimer, SIGNAL(timeout()), this, SLOT(bonusTimerHit()));
ui->lblTitle->setPixmap(QPixmap(":/images/LevelClear.png"));
ui->lblBackground->setStyleSheet("");
ui->lblBonusText->show();
ui->lblBonusText->raise();
bonusAmount = 0;
bonusTimer->start();
}
}
EndGame::~EndGame()
{
delete ui;
}
bool EndGame::checkHighScore(){
HighScore::instance().LoadScore("data/" + World::instance().getLevelName());
World::instance().setScore(World::instance().getScore() + bonusAmount);
if (World::instance().getScore() > HighScore::instance().getLowestScore()) {
return true;
} else {
return false;
}
}
void EndGame::on_PBcontinue_clicked()
{
if (!gameOver && checkHighScore()) {
int place = HighScore::instance().NewHighScore(World::instance().getScore());
TitleScreen * title = new TitleScreen(widgetParent);
title->show();
title->raise();
HighScorePage * highScoreScreen = new HighScorePage(title);
highScoreScreen->setScore(World::instance().getScore());
highScoreScreen->setPlace(place);
for( int i = 0; i < highScoreScreen->children().size(); i++) {
QLabel* textLabel =dynamic_cast<QLabel*>(highScoreScreen->children().at(i));
if( textLabel != NULL ) {
textLabel->hide();
}
}
highScoreScreen->show();
highScoreScreen->raise();
highScoreScreen->showNameEnter(true);
}
else
{
TitleScreen* title = new TitleScreen(widgetParent);
title->show();
title->raise();
}
deleteLater();
}
void EndGame::bonusTimerHit() {
bonusToAdd--;
if (bonusToAdd == 0){
bonusAmount+=2;
bonusTimer->stop();
ui->lblBonusText->setText("+" + QString("%1").arg(bonusAmount));
ui->PBcontinue->setEnabled(true);
} else {
bonusAmount+=2;
ui->lblBonusText->setText("+" + QString("%1").arg(bonusAmount));
}
}
| [
"abprice96@yahoo.com"
] | abprice96@yahoo.com |
ffd354da588ce90264ec21f906b6056fcd8f785b | da32fbba218a59f69368221effded57e62e7d5ed | /boardelement.cpp | a35dfd72ff251c2077aaf270b71735d88453ce40 | [] | no_license | xabialonso14/gameoflife | 62bd50cbf913deb288c2f23d1ae7b694f2353c45 | 96914234baef839d97746bd79175322020681708 | refs/heads/master | 2020-03-25T09:04:03.783379 | 2018-10-27T12:32:55 | 2018-10-27T12:32:55 | 143,645,460 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 313 | cpp | #include "boardelement.h"
BoardElement::BoardElement()
{
}
void BoardElement::setAlive(bool alive)
{
this->alive = alive;
}
void BoardElement::setSign(char sign)
{
this->sign = sign;
}
bool BoardElement::getAlive() const
{
return alive;
}
char BoardElement::getSign() const
{
return sign;
}
| [
"pawel.jardzioch@globallogic.com"
] | pawel.jardzioch@globallogic.com |
6b9716466bba8429affabe5e5278cba700f09a73 | 59d26f54e985df3a0df505827b25da0c5ff586e8 | /OJ_UVA/completed/10235 - Simply Emirp_completed_2.cpp | 12832949242d549e745a68eb87ff4d95ddf45b34 | [] | no_license | minhaz1217/My-C-Journey | 820f7b284e221eff2595611b2e86dc9e32f90278 | 3c8d998ede172e9855dc6bd02cb468d744a9cad6 | refs/heads/master | 2022-12-06T06:12:30.823678 | 2022-11-27T12:09:03 | 2022-11-27T12:09:03 | 160,788,252 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,361 | cpp | #include<iostream>
using namespace std;
#define check(a) cout<<a<< endl;
int main(){
int n,rev=0,temp,i,j,flag = 0;
for(;;){
cin >>n;
if(cin.eof()){
break;
}
flag = 0;
if(n!=2 && n%2 == 0){
flag = 1;
}else{
for(i=3;i<=n/2;i+=2){
if(n%i == 0){
flag = 1;
break;
}
}
}
if(flag ==0){
temp = n;
rev = 0;
while(temp!=0){
rev = rev*10 + temp%10;
temp = temp/10;
}
if(rev == n){
cout << n << " is prime." << endl;
}else{
flag = 0;
if(rev!=2 && rev%2 ==0){
flag = 1;
}else{
for(i=3;i<=rev/2;i+=2){
if(rev%i == 0){
flag = 1;
break;
}
}
}
if(flag ==0){
cout << n << " is emirp." << endl;
}else{
cout << n << " is prime." << endl;
}
}
}else{
cout << n << " is not prime." << endl;
}
}
return 0;
}
| [
"minhaz1217@gmail.com"
] | minhaz1217@gmail.com |
181ee8e99e85557b28934b4891fbaac0850ff37c | 50c68e1bd6e421af0b79ff50080995a87bd78b0c | /firmware/polymer/webclient/webclient.cc | 89bc2f70ea5bfb9408cae4534a61574a81230123 | [] | no_license | spacekate/imok | a0e3ab4dab693fc736e40fa953cc6c5f6fb0c4bc | 73d071b7378f9a80a3b26d8052703ec84a854670 | refs/heads/master | 2021-01-23T11:34:00.080644 | 2010-01-05T03:06:22 | 2010-01-05T03:06:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 886 | cc | #include "WProgram.h"
#include <enc28j60.h>
#include "Polymer.h"
//Config params- to be revisited
static uint8_t mac[6] = {0x54,0x55,0x58,0x10,0x00,0x24};
Polymer polymer = Polymer();
//http://zedcode.blogspot.com/2007/02/gcc-c-link-problems-on-small-embedded.html
//to keep from needing to link to c++ std lib, maybe? not totally sure
// solves this error:
//../../libarduino/libarduinocore.a(Print.o):(.data+0x6): undefined reference to `__cxa_pure_virtual'
extern "C" void __cxa_pure_virtual(void)
{
// call to a pure virtual function happened ... wow, should never happen ... stop
for(;;)
{
}
}
int main()
{
init(); // This is the arduino init code
setup();
for(;;)
{
loop();
}
return 0;
}
void setup()
{
Serial.begin(9600);
Serial.println("Setup..");
polymer.init(mac);
Serial.println("Setup Complete");
}
void loop()
{
polymer.loop();
}
| [
"hamish@currie.to"
] | hamish@currie.to |
e2097c67c518d644fa603e535f78e416e580c9fd | 2ea8f750cfd89ed7aac11e9414e3f803124c0bc3 | /001.cpp | 50ac329e03584fb263b4752720269c5e6071e399 | [] | no_license | dvdfu/project-euler | 328d1d3d40b806733e58f5b88bbae0a8ecfdf736 | aadfb73eb5d33e65ff29faa305304282eb9b05ab | refs/heads/master | 2016-09-06T19:18:24.339088 | 2014-06-25T18:23:27 | 2014-06-25T18:23:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 188 | cpp | #include <iostream>
using namespace std;
int main() {
int sum = 0;
for (int i = 0; i < 1000; i++) {
if (i%3 == 0 || i%5 == 0) {
sum += i;
}
}
cout << sum << endl;
return 0;
} | [
"davidf1212@gmail.com"
] | davidf1212@gmail.com |
e51baa54b554966d3e0c057fd895596c2ddc8877 | 705db8af8c18c0157e9f35278213ab4a02688150 | /keyboardDLLTest/keyboard/widgets/formdigital.h | 3328597ccf5d47ca0c61c7ccc41b3cc6c81cd6c1 | [] | no_license | ImIves/keyboardDllTest | e3ec68ccba3b748f387dffb92968abb6dc37bb7e | c82f8e069fdeaafe572be682e62f74ac389647cd | refs/heads/master | 2020-04-02T21:08:19.287655 | 2018-10-26T11:13:52 | 2018-10-26T11:13:52 | 154,788,894 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 724 | h | #ifndef FORMDIGITAL_H
#define FORMDIGITAL_H
#include <QWidget>
#include <QLineEdit>
namespace Ui {
class FormDigital;
}
class FormDigital : public QWidget
{
Q_OBJECT
public:
explicit FormDigital(QWidget *parent = 0);
~FormDigital();
void setInputEdit(QWidget *inputEdit);
public slots:
void clickButton(int index);
void showKeyboard(QPoint pt, QRect focusWidget);
void hideKeyboard();
bool isVisible() const;
void pressKey(int key);
void focusChanged(QWidget* oldWidget,QWidget* newWidget);
signals:
void commit(QString str);
private:
Ui::FormDigital *ui;
QLineEdit *inputEdit;
QWidget* m_inputEdit;
};
#endif // FORMDIGITAL_H
| [
"somepure@foxmail.com"
] | somepure@foxmail.com |
5b8f35fa595e0fb80df4c9508677fea3c6295727 | 587eae764fc4104e24b5c83f763b06dbf085158c | /CloakCompiler/CloakCompiler.cpp | 50aca01b9b961de272d7e42f90773e2622e90dc3 | [
"BSD-2-Clause"
] | permissive | Bizzarrus/CloakEngine | 6cc96c297370e5c9d9b536412c3843d7e85f8565 | 0890eaada76b91be89702d2a6ec2dcf9b2901fb9 | refs/heads/master | 2020-06-26T02:14:02.715291 | 2019-10-09T17:30:46 | 2019-10-09T17:30:46 | 199,494,307 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 153 | cpp | // CloakCompiler.cpp : Definiert die exportierten Funktionen für die DLL-Anwendung.
//
#include "stdafx.h"
#include "CloakEngine/CloakEngine.h"
| [
"noreply@github.com"
] | noreply@github.com |
43959cf621384bd39342aeee06c5a1f1a683e2c0 | b765e310279d2ed78c5fb8e9648c7610b3dbb3e3 | /cs_state_mgr.h | 2cf481082208aa07d419c45e789dac428f2fbfd7 | [
"Apache-2.0"
] | permissive | BigJoe01/cornerstone_raknet | 10045980068998ce0c8a6762df6401ac2c443b8f | 074002207e69a55bee22e4749f879b40ae6024b7 | refs/heads/master | 2021-01-11T19:53:48.564519 | 2017-01-20T06:07:09 | 2017-01-20T06:07:09 | 79,420,411 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,253 | h | /**
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. The ASF licenses
* this file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _STATE_MGR_HXX_
#define _STATE_MGR_HXX_
namespace cornerstone {
class CStateManager {
__interface_body__(CStateManager)
public:
virtual CPtr<CClusterConfig> LoadConfig() = 0;
virtual void SaveConfig(const CClusterConfig& config) = 0;
virtual void SaveState(const CServerState& state) = 0;
virtual CPtr<CServerState> ReadState() = 0;
virtual CPtr<CLogStore> LoadLogStore() = 0;
virtual int32 ServerId() = 0;
virtual void SystemExit(const int exit_code) = 0;
};
}
#endif //_STATE_MGR_HXX_ | [
"noreply@github.com"
] | noreply@github.com |
473406e53a57b6d6150ab13b8ac3ffecb85e2425 | 3e7ba6ed1dfa3ae726c6931a7614019aa3e6e19c | /src/tritonsort/mapreduce/workers/boundarydecider/BoundaryDecider.h | e428c462173f3de05950844b9d079c08d9d3000b | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | huafengw/themis_tritonsort | c1c869eed6a433724928561d2ed8c0defe4401c2 | 93cc9eff49c8ec9b00a0fe12076652970c729b8e | refs/heads/master | 2020-12-24T16:43:04.558776 | 2016-07-15T05:37:55 | 2016-07-15T05:37:55 | 61,021,212 | 0 | 0 | null | 2016-06-13T08:40:24 | 2016-06-13T08:40:21 | null | UTF-8 | C++ | false | false | 2,387 | h | #ifndef MAPRED_BOUNDARY_DECIDER_H
#define MAPRED_BOUNDARY_DECIDER_H
#include <vector>
#include "core/MultiQueueRunnable.h"
#include "core/constants.h"
#include "mapreduce/common/KVPairBufferFactory.h"
#include "mapreduce/common/KeyValuePair.h"
#include "mapreduce/common/SimpleKVPairWriter.h"
#include "mapreduce/common/buffers/KVPairBuffer.h"
#include "mapreduce/common/sorting/QuickSortStrategy.h"
/**
BoundaryDecider is responsible for deciding upon the job-wide partition
boundary list. Each node picks its own version of the boundary list in the
BoundaryScanner. Those lists are funneled to a single BoundaryDecider, which
chooses the median key for each partition as the official boundary key.
*/
class BoundaryDecider : public MultiQueueRunnable<KVPairBuffer> {
WORKER_IMPL
public:
/// Constructor
/**
\param id the id of the worker
\param name the name of the worker
\param memoryAllocator a memory allocator used for new buffers
\param defaultBufferSize the default size of output buffers
\param alignmentSize the memory alignment of output buffers
\param numNodes the number of nodes in the cluster
\param isCoordinatorNode if true, this node is the coordinator
*/
BoundaryDecider(
uint64_t id, const std::string& stageName,
MemoryAllocatorInterface& memoryAllocator, uint64_t defaultBufferSize,
uint64_t alignmentSize, uint64_t numNodes, bool isCoordinatorNode);
/**
Take in boundary buffers from all nodes and, for each partition, sort the
keys and pick the median key as the official boundary key.
*/
void run();
private:
typedef std::vector<KVPairBuffer*> BufferVector;
typedef std::vector<KeyValuePair> TupleVector;
/// Used internally to get an output chunk buffer
/**
\param tupleSize the size of a tuple to be written
\return a new chunk buffer
*/
KVPairBuffer* getOutputChunk(uint64_t tupleSize);
/// Used internally to broadcast chunk buffers to all nodes.
/**
\param outputChunk the chunk to broadcast
*/
void broadcastOutputChunk(KVPairBuffer* outputChunk);
const bool isCoordinatorNode;
const uint64_t numNodes;
uint64_t jobID;
KVPairBufferFactory bufferFactory;
SimpleKVPairWriter writer;
BufferVector buffers;
TupleVector kvPairs;
QuickSortStrategy sortStrategy;
};
#endif // MAPRED_BOUNDARY_DECIDER_H
| [
"mconley@cs.ucsd.edu"
] | mconley@cs.ucsd.edu |
840dd56130c63973fda04bb2e91a9c2ecd7b1612 | ce2beb0878797a8ae88e07e56fcf8c2d0402ac5f | /e087/primes.h | f1be9cb99ad0b80180cdef1becaca94764fc8607 | [] | no_license | cslarsen/project-euler | 2de49ad9be9b0bfe7c5b22c0e2272992e8f07151 | fd1c7664891a5503aedaccb936b66eeb87d6085b | refs/heads/master | 2020-07-08T00:17:29.605171 | 2015-09-14T17:45:23 | 2015-09-14T17:45:23 | 6,430,645 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,335 | h | /*
* A fast SIEVE OF ERATOSTHENES using BIT SETS and VECTOR to remember them.
*
* Copyright (c) 2012 Christian Stigen Larsen
* http://csl.sublevel3.org
*
* Distributed under the BSD 3-clause license; see the file LICENSE.
*
*/
#include <vector>
#include <algorithm>
#include <bitset>
#include <inttypes.h>
template<typename INT = uint64_t, size_t PRIMES = 1000000>
class prime_sieve
{
public:
std::bitset<PRIMES> p;
std::vector<INT> v;
prime_sieve()
{
rebuild();
}
void rebuild()
{
p.reset();
p.flip();
p[0] = p[1] = 1;
for ( size_t n=2; n < PRIMES; ++n )
if ( p[n] ) {
v.push_back(n);
for ( size_t m=n<<1; m < PRIMES; m += n )
p[m] = 0;
}
}
INT operator[](const size_t n) const
{
return v[n];
}
inline bool isprime(const INT& n) const
{
return p[n];
}
inline bool isprime_safe(const INT& n) const
{
return p.at(n);
}
inline size_t size() const
{
return v.size();
}
inline typename std::vector<INT>::const_iterator first() const
{
return v.begin();
}
inline typename std::vector<INT>::const_iterator last() const
{
return v.end();
}
inline typename std::vector<INT>::const_iterator find(const INT& n) const
{
return std::equal_range(v.begin(), v.end(), n).second;
}
};
| [
"csl@sublevel3.org"
] | csl@sublevel3.org |
786695ed94fd2b0c8202b2228eb12e1d55d96924 | a0ba28466bd1b26a02ed36e03339567f00ce1617 | /projects/optim/default/default.h | 71d6cddfcc2908a92a38a563071e7f5752c63c81 | [] | no_license | AxelFinke/monte-carlo-rcpp | 64e80efd70c24102db0e6bcd797d7b1d6a0a8981 | 2505ba9932de1956f9b716566c6c53d29eed2ed8 | refs/heads/master | 2020-04-01T00:44:03.937547 | 2018-11-27T11:29:15 | 2018-11-27T11:29:15 | 152,710,796 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,763 | h | /// \file
/// \brief Functions for implementing the optim class in the absence of reparametrisation.
///
/// This file contains the functions for the optim class
/// if no non-centred parametrisation is used.
#ifndef __DEFAULT_H
#define __DEFAULT_H
#include "projects/optim/Optim.h"
// [[Rcpp::depends("RcppArmadillo")]]
///////////////////////////////////////////////////////////////////////////////
/// Member functions of the class <<Optim>>
///////////////////////////////////////////////////////////////////////////////
/// Reparametrises latent variables from the standard (centred) parametrisation
/// to a (partially) non-centred parametrisation.
template <class ModelParameters, class LatentVariable, class LatentPath, class LatentPathRepar, class Observations, class Particle, class Aux, class SmcParameters, class McmcParameters>
void Optim<ModelParameters, LatentVariable, LatentPath, LatentPathRepar, Observations, Particle, Aux, SmcParameters, McmcParameters>::convertLatentPathToLatentPathRepar(const arma::colvec& theta, const LatentPath& latentPath, LatentPathRepar& latentPathRepar)
{
latentPathRepar = latentPath;
}
/// Reparametrises latent variables from (partially) non-centred parametrisation
/// to the standard (centred) parametrisation
template <class ModelParameters, class LatentVariable, class LatentPath, class LatentPathRepar, class Observations, class Particle, class Aux, class SmcParameters, class McmcParameters>
void Optim<ModelParameters, LatentVariable, LatentPath, LatentPathRepar, Observations, Particle, Aux, SmcParameters, McmcParameters>::convertLatentPathReparToLatentPath(const arma::colvec& theta, LatentPath& latentPath, const LatentPathRepar& latentPathRepar)
{
latentPath = latentPathRepar;
}
#endif
| [
"axelfinke42@gmail.com"
] | axelfinke42@gmail.com |
bb277a9a000c4211e2c008163952f21da70895e5 | 1f85142263a08d2e20080f18756059f581d524df | /lib/tags/lib-1.11.2.0/src/pagespeed/rules/minify_rule_test.cc | bc739b756bcf343d7ec25bb66ef69839e50a7ad1 | [
"Apache-2.0"
] | permissive | songlibo/page-speed | 60edce572136a4b35f4d939fd11cc4d3cfd04567 | 8776e0441abd3f061da969644a9db6655fe01855 | refs/heads/master | 2021-01-22T08:27:40.145133 | 2016-02-03T15:34:40 | 2016-02-03T15:34:40 | 43,261,473 | 0 | 0 | null | 2015-09-27T19:32:17 | 2015-09-27T19:32:17 | null | UTF-8 | C++ | false | false | 4,026 | cc | // Copyright 2009 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <string>
#include "pagespeed/l10n/l10n.h"
#include "pagespeed/rules/minify_rule.h"
#include "pagespeed/testing/pagespeed_test.h"
using pagespeed::Resource;
using pagespeed::UserFacingString;
using pagespeed::rules::MinifierOutput;
namespace {
// Replace all resources with a tiny plain-text file. This would certainly
// make the web much faster, if less useful.
class FoobarMinifier : public pagespeed::rules::Minifier {
public:
FoobarMinifier() {}
virtual ~FoobarMinifier() {}
// Minifier interface:
virtual const char* name() const { return "FoobarRule"; }
virtual UserFacingString header_format() const {
return not_localized("Test rule");
}
virtual UserFacingString body_format() const {
return not_localized("$1 $2");
}
virtual UserFacingString child_format() const {
return not_localized("$1 $2 $3");
}
virtual const MinifierOutput* Minify(const Resource& resource) const;
private:
DISALLOW_COPY_AND_ASSIGN(FoobarMinifier);
};
const MinifierOutput* FoobarMinifier::Minify(const Resource& resource) const {
const std::string minified = "foobar";
const int savings = resource.GetResponseBody().size() - minified.size();
return new MinifierOutput(savings, minified, "text/plain");
}
class FoobarRule : public pagespeed::rules::MinifyRule {
public:
FoobarRule() : pagespeed::rules::MinifyRule(new FoobarMinifier()) {}
virtual ~FoobarRule() {}
private:
DISALLOW_COPY_AND_ASSIGN(FoobarRule);
};
class MinifyTest : public pagespeed_testing::PagespeedRuleTest<FoobarRule> {
protected:
void AddTestResource(const std::string &url,
const std::string &body) {
Resource* resource = new Resource;
resource->SetRequestUrl(url);
resource->SetRequestMethod("GET");
resource->SetResponseStatusCode(200);
resource->SetResponseBody(body);
AddResource(resource);
}
};
TEST_F(MinifyTest, NoProblems) {
AddTestResource("http://www.example.com/foo.txt",
"foo");
CheckNoViolations();
}
TEST_F(MinifyTest, Unminified) {
AddTestResource("http://www.example.com/foobarbaz.txt",
"foo bar baz");
CheckOneUrlViolation("http://www.example.com/foobarbaz.txt");
// Check that associated_result_id gets set properly.
pagespeed::FormattedResults formatted_results;
FormatResultsAsProto(&formatted_results);
const pagespeed::FormattedUrlResult& url_result =
formatted_results.rule_results(0).url_blocks(0).urls(0);
const pagespeed::Result& res = result(0);
ASSERT_EQ(res.id(), url_result.associated_result_id());
}
TEST_F(MinifyTest, TwoResources) {
AddTestResource("http://www.example.com/foo.txt",
"foo bar baz");
AddTestResource("http://www.example.com/blah.txt",
"blah blah blah");
CheckTwoUrlViolations("http://www.example.com/foo.txt",
"http://www.example.com/blah.txt");
// Check that associated_result_id is different for each resource.
pagespeed::FormattedResults formatted_results;
FormatResultsAsProto(&formatted_results);
const pagespeed::FormattedUrlResult& url_result1 =
formatted_results.rule_results(0).url_blocks(0).urls(0);
const pagespeed::FormattedUrlResult& url_result2 =
formatted_results.rule_results(0).url_blocks(0).urls(1);
ASSERT_NE(url_result1.associated_result_id(),
url_result2.associated_result_id());
}
} // namespace
| [
"bmcquade@google.com"
] | bmcquade@google.com |
154e4aa7715e9025e388f7ec1577835d4a385a15 | 6a8c753e0a8a875081de164e00ca792496ec4478 | /Pegasus/inc/DomainListMachines.cpp | ee3d38a40abddb8a76c0305368ff798b3e6dbc69 | [] | no_license | xchwarze/Pegasus | 5f7ba8adb142adebda16006ca324c1d3d275643e | f83159ebcc2b2ba429b23805fdc66ab3eb2959f5 | refs/heads/master | 2021-03-12T06:09:21.916475 | 2018-07-12T08:49:16 | 2018-07-12T08:49:16 | 246,596,446 | 1 | 1 | null | 2020-03-11T14:40:30 | 2020-03-11T14:40:30 | null | UTF-8 | C++ | false | false | 7,448 | cpp | /*
DomainListMachines.cpp
Enums visible machines in current or any specified domain
NB: keep in mind need of local disks scan for *.rdp to get addresses and credentials from there
*/
#include <windows.h>
#include "..\inc\dbg.h"
#include "DomainListMachines.h"
#ifdef ROUTINES_BY_PTR
DomainListMachines_ptrs DomainListMachines_apis; // global var for transparent name translation into call-by-pointer
// should be called before any other apis used to fill internal structures
VOID DomainListMachines_resolve(DomainListMachines_ptrs *apis)
{
#ifdef _DEBUG
if (IsBadReadPtr(apis, sizeof(DomainListMachines_ptrs))) { DbgPrint("DBG_ERR: bad read ptr %p len %u", apis, sizeof(DomainListMachines_ptrs)); }
#endif
// save to a global var
DomainListMachines_apis = *apis;
}
#else
#include <lm.h> // NetServerEnum()
#include <winnetwk.h> // WNetOpenEnum / WNetEnumResource
#include "..\inc\mem.h"
#include "..\inc\dbg.h"
// link essential libs
#pragma comment(lib, "netapi32.lib") // NetServerEnum()
#pragma comment(lib, "mpr.lib") // WNetOpenEnum / WNetEnumResource
/*
Fill passed structure with ptrs to all exported functions
Used when module compiled as code to provide ptrs to some other child code
*/
VOID DomainListMachines_imports(DomainListMachines_ptrs *apis)
{
apis->fndlmEnumV1 = dlmEnumV1;
apis->fndlmEnumV2 = dlmEnumV2;
}
// performs enum using Browser service (NetServerEnum)
// wszDomain should be NULL for current domain
BOOL dlmEnumV1(LPWSTR wszDomain)
{
BOOL bRes = FALSE; // func result
NET_API_STATUS nStatus; // NetServerEnum() result
LPSERVER_INFO_101 pBuf = NULL;
LPSERVER_INFO_101 pTmpBuf;
DWORD dwEntriesRead = 0;
DWORD dwTotalEntries = 0;
DWORD i;
DbgPrint("entered");
// query netapi
nStatus = NetServerEnum(NULL, 101, (LPBYTE *)&pBuf, MAX_PREFERRED_LENGTH, &dwEntriesRead, &dwTotalEntries, SV_TYPE_ALL, wszDomain, NULL);
// check for error
if ((nStatus != NERR_Success) && (nStatus != ERROR_MORE_DATA)) { DbgPrint("ERR: NetServerEnum() unexpected status %04Xh", nStatus); return bRes; }
if (!(pTmpBuf = pBuf)) { DbgPrint("ERR: received NULL ptr"); return bRes; }
// do enum
for (i = 0; i < dwEntriesRead; i++) {
if (!pTmpBuf) { DbgPrint("ERR: got NULL ptr"); break; }
DbgPrint("[%01u] name[%ws] ver%d.%d platform %d type %08Xh", i + 1, pTmpBuf->sv101_name, pTmpBuf->sv101_version_major,
pTmpBuf->sv101_version_minor, pTmpBuf->sv101_platform_id, pTmpBuf->sv101_type);
pTmpBuf++;
} // for i
// free buffer allocated by called func
if (pBuf != NULL) { NetApiBufferFree(pBuf); }
return bRes;
}
// receives and parses each item of NETRESOURCE structure
BOOL _dlmWnetParseStructure(int iPos, LPNETRESOURCE lpnrLocal, LPWSTR wszCurrentDomain, WNETENUMITEMSFUNC efnEnumFunc, LPVOID pCallbackParam)
{
/*
DbgPrint("[%ws] i=%d dwType=%u dwDisplayType=%u dwUsage=%04Xh lpLocalName=[%ws] lpRemoteName=[%ws] lpComment=[%ws]",
wszCurrentDomain,
iPos, lpnrLocal->dwType, lpnrLocal->dwDisplayType, lpnrLocal->dwUsage,
lpnrLocal->lpLocalName, lpnrLocal->lpRemoteName, lpnrLocal->lpComment);
*/
// lpnrLocal->dwDisplayType are RESOURCEDISPLAYTYPE_* from WinNetWk.h
// on each item, pass it to enum function, if defined
if (efnEnumFunc) { return efnEnumFunc(lpnrLocal, wszCurrentDomain, pCallbackParam); } else { return TRUE; }
}
// recursive enum function for WNetOpenEnum / WNetEnumResource
// wszCurrentDomain is used internall to pass by ptr to current domain while enumerating it's items
// bEnumAllNetworks controls if need to enum all machines in all available networks
BOOL WINAPI _dlmWnetEnumFunc(LPNETRESOURCE lpnr, BOOL bEnumShares, LPWSTR wszCurrentDomain, BOOL bEnumAllNetworks, WNETENUMITEMSFUNC efnEnumFunc, LPVOID pCallbackParam)
{
BOOL bRes = FALSE; // function result
DWORD dwResult, dwResultEnum; // api call results
HANDLE hEnum = NULL; // for WNetOpenEnum
DWORD cbBuffer = 16384 * 4; // 16K is a good size
DWORD cEntries = -1; // enumerate all possible entries
LPNETRESOURCE lpnrLocal = NULL; // pointer to enumerated structures
DWORD i;
LPWSTR wszDomainLocal = wszCurrentDomain;
DWORD dwScope = RESOURCE_CONTEXT; // by default, enum local group
if (bEnumAllNetworks) { dwScope = RESOURCE_GLOBALNET; }
dwResult = WNetOpenEnum(dwScope, // selected network resources
RESOURCETYPE_ANY, // all resources
0, // enumerate all resources
lpnr, // NULL first time the function is called
&hEnum); // handle to the resource
if (dwResult != NO_ERROR) { /* DbgPrint("ERR: WNetOpenEnum() le %04Xh", GetLastError()); */ return bRes; }
// alloc resulting array buffer
lpnrLocal = (LPNETRESOURCE)my_alloc(cbBuffer);
do {
// wipe buffer on every iteration
memset(lpnrLocal, 0, cbBuffer);
dwResultEnum = WNetEnumResource(hEnum, // resource handle
&cEntries, // defined locally as -1
lpnrLocal, // LPNETRESOURCE
&cbBuffer); // buffer size
// check for ok result
if (dwResultEnum != NO_ERROR) {
// if a real error occured, like ERROR_ACCESS_DENIED (5) on enumerating shares on different domain / from non-authorized account
if (dwResultEnum != ERROR_NO_MORE_ITEMS) { DbgPrint("ERR: WNetEnumResource() le %04Xh", GetLastError()); break; }
break;
} // ! NO_ERROR result
// ok result if got here, proceed with item parse
for (i = 0; i < cEntries; i++) {
// if got new domain - save for next calls
if (lpnrLocal[i].dwDisplayType == RESOURCEDISPLAYTYPE_DOMAIN) { wszDomainLocal = lpnrLocal[i].lpRemoteName; }
// invoke callback and check if it allows to parse further
if (!_dlmWnetParseStructure(i, &lpnrLocal[i], wszDomainLocal, efnEnumFunc, pCallbackParam)){
DbgPrint("callback asked to stop enum, exiting");
// set like all items are ended
dwResultEnum = ERROR_NO_MORE_ITEMS;
break; // from for i
}
// check for RESOURCEUSAGE_CONTAINER flag set -> need to go deeper
if (RESOURCEUSAGE_CONTAINER == (lpnrLocal[i].dwUsage & RESOURCEUSAGE_CONTAINER)) {
// check if allowed to parse shares
if (lpnrLocal[i].dwDisplayType == RESOURCEDISPLAYTYPE_SERVER) {
if (bEnumShares) { _dlmWnetEnumFunc(&lpnrLocal[i], bEnumShares, wszDomainLocal, bEnumAllNetworks, efnEnumFunc, pCallbackParam); } //else { DbgPrint("forbidden to enum shares"); }
} else {
// this to prevent looping on enumerating only local network
if ((bEnumAllNetworks) || ((!bEnumAllNetworks) && (i > 0))) {
_dlmWnetEnumFunc(&lpnrLocal[i], bEnumShares, wszDomainLocal, bEnumAllNetworks, efnEnumFunc, pCallbackParam);
}
}
} // RESOURCEUSAGE_CONTAINER check
} // for
} while (dwResultEnum != ERROR_NO_MORE_ITEMS);
// check for ok finish
if (dwResultEnum == ERROR_NO_MORE_ITEMS) { bRes = TRUE; }
// free used resources
my_free(lpnrLocal);
WNetCloseEnum(hEnum);
//DbgPrint("all done");
return bRes;
}
// performs enum using WNetOpenEnum / WNetEnumResource
BOOL dlmEnumV2(BOOL bEnumShares, BOOL bEnumAllNetworks, WNETENUMITEMSFUNC efnEnumFunc, LPVOID pCallbackParam)
{
//BOOL bRes = FALSE;
return _dlmWnetEnumFunc(NULL, bEnumShares, NULL, bEnumAllNetworks, efnEnumFunc, pCallbackParam);
//return bRes;
}
#endif | [
"you@example.com"
] | you@example.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.