text
stringlengths 8
6.88M
|
|---|
#include "Generador.h"
#include "Constantes.h"
#include "ziggurat.h"
#include <ctime>
#include <cstdio>
#include <cstdlib>
circle * randGenerator(float mu, float sigma)
{
//////pseudorandom normal distributed float between 0 and 1//////
//Implementation of the Zigurat algorithm
float fn[128];
int i;
uint32_t kn[128];
uint32_t seed;
float wn[128], num;
circle *list_circles = new circle[NUM_CIRCLES];
//pseudorandom initialization
time_t t;
srand((unsigned) time(&t));
r4_nor_setup ( kn, fn, wn );
//pseudorandom seed
seed = rand();
for (i = 0; i < NUM_CIRCLES; i++) {
//Truncated normal distribution between 0 and 0.25 for the radius
do{
num = r4_nor ( seed, kn, fn, wn );
list_circles[i].radius = ( sigma * num ) + mu;
}while(num > 0 && num < 0.25);
//Uniform distribution between 0 and 1 for the centers
list_circles[i].center.x = r4_uni ( seed );
list_circles[i].center.y = r4_uni ( seed );
//printf ( " %14f\t%14f\n%14f\n", list_circles[i].radio, list_circles[i].center.x, list_circles[i].center.y );
}
return list_circles;
}
|
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long
#define pii pair<int,int>
#define all(x) begin(x), end(x)
#define loop(i,n) for(int i=0; i<n; i++)
#define rep(i,a,b,c) for(int i=a; i<b; i+=c)
#define tc(t) int t; cin>>t; while(t--)
#define sz(v) int((v).size())
#define pb push_back
#define int long long
int32_t main() {
IOS;
int n;
tc (t) {
cin>>n;
vector<int> v(n);
loop(i, n) cin>>v[i];
int res = 0, maxLeft=v[0], maxDiff=0;
rep (i, 1, n, 1) {
if (v[i]<maxLeft) {
maxDiff = max(maxDiff, maxLeft-v[i]);
}
maxLeft=max(v[i], maxLeft);
}
int sum=0, i=0;
while (sum < maxDiff) {
res++;
sum+=1<<i;
i++;
}
cout<<res<<endl;
}
return 0;
}
|
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
// Stack: inorder traversal
// 1) Do In-Order Traversal of the given tree and store the result in a temp array.
// 2) Check if the temp array is sorted in ascending order, if it is, then the tree is BST.
class Solution {
public:
bool isValidBST(TreeNode* root) {
if (!root) return true;
stack<TreeNode*> st;
TreeNode * p = root, * pre = NULL;
while (p || !st.empty()) { // inorder traversal
while (p) { // left
st.push(p);
p = p->left;
}
p = st.top(); st.pop(); // mid
if (pre && p->val <= pre->val) return false; // logic, must be <=
pre = p;
p = p->right; // right
}
return true;
}
};
|
// ********************************************************************************************************************************
// Floyd Warshall Shortest Path Algorithm
// Input: Takes a the number of vertices on the first line, the
// number of edges on the second line, a list of edges,
// and then a query.
// Output: Outputs the shortest path and the length of the path
// Restrictions: There are at most 1000 vertices
// The weight of each edge is in-between 1 and 100
// Edges can be listed in any order
// At least two vertices and one edge in input
// There are no errors in input
// Complexity: O(n^3) where n is the number of vertices
// Sample Input:
// 6
// 7
// 1 2 3
// 1 4 7
// 2 5 2
// 3 5 6
// 3 6 6
// 4 2 3
// 5 4 1
// 1 4
// Sample Output:
// 1
// 2
// 5
// 4
// 6
// ********************************************************************************************************************************
#include <iostream>
#include <sstream>
#include <string>
#include <stdlib.h>
#include <stack>
using namespace std;
#define INF 101
void printDoubleArray(int **w, int vertices, int offset){
for(int i = 0; i < vertices; i++){
for(int j = 0; j < vertices; j++){
cout << w[i][j]+offset << " ";
}
cout << endl;
}
}
void printStack(stack<int> s){
while(!s.empty()){
cout << s.top() + 1 << endl;
s.pop();
}
}
void getShortestPath(int **predecessor, int i, int j){
stack<int> sequence;
int k = j;
while(k != i){
k = predecessor[i][k];
sequence.push(k);
}
printStack(sequence);
}
int** FloydWarshall(int **w, int n, int b, int e){
int **predecessor;
predecessor = new int *[n];
for(int i = 0; i < n; i++){
predecessor[i] = new int[n];
for(int j = 0; j < n; j++){
if(i == j || w[i][j] == INF){
predecessor[i][j] = -1;
}else{
predecessor[i][j] = i;
}
}
}
for(int m = 0; m < n; m++){
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
if(w[i][j] <= w[i][m] + w[m][j]){
w[i][j] = w[i][j];
}else{
w[i][j] = w[i][m] + w[m][j];
predecessor[i][j] = predecessor[m][j];
}
}
}
}
getShortestPath(predecessor, b, e);
cout << e + 1 << endl;
cout << w[b][e] << endl;
return w;
}
int main(){
int vertices;
int edges;
cin >> vertices;
int **w;
w = new int *[vertices];
for(int i = 0; i < vertices; i++){
w[i] = new int[vertices];
for(int j = 0; j < vertices; j++){
if(i == j){
w[i][j] = 0;
}else{
w[i][j] = INF;
}
}
}
cin >> edges;
int value;
int current = 0;
string temp;
string s;
int c = 0;
getline(cin, s);
while(c < edges){
getline(cin, s);
int tail, head, weight;
istringstream iss(s);
iss >> temp; //get tail
tail = atoi(temp.c_str());
iss >> temp; //get head
head = atoi(temp.c_str());
iss >> temp; //get weight
weight = atoi(temp.c_str());
w[tail- 1][head - 1] = weight;
c++;
}
int begin, end;
cin >> begin;
cin >> end;
FloydWarshall(w, vertices, begin - 1, end - 1);
}
|
#ifndef LIST_H
#define LIST_H
#include <iostream>
template<typename T>
class List {
private:
class Node {
public:
T data;
Node *prev, *next;
explicit Node(T value) : data(value), prev(nullptr), next(nullptr) {}
Node(T value, Node* prev, Node* next) : data(value), prev(prev), next(next) {}
};
size_t size;
Node *head, *tail;
public:
List() : head(nullptr), tail(nullptr), size(0) {}
~List() {
this->clear();
}
void push_back(T value) {
Node *temp = new Node(value);
if (!isEmpty()) {
temp->prev = tail;
tail->next = temp;
tail = temp;
size++;
} else {
head = temp;
tail = temp;
size++;
}
}
void push_front(T value) {
Node *temp = new Node(value);
if (!isEmpty()){
head->prev = temp;
temp->next = head;
head = temp;
size++;
} else {
head = temp;
tail = temp;
size++;
}
}
void pop_back() {
Node *temp = tail;
if (head != tail) {
tail = tail->prev;
tail->next = nullptr;
delete temp;
size--;
} else {
if (!isEmpty())
size--;
head = nullptr;
tail = nullptr;
delete temp;
}
}
void pop_front() {
Node *temp = head;
if (head != tail) {
head = head->next;
head->prev = nullptr;
delete temp;
size--;
} else {
if (!isEmpty())
size--;
head = nullptr;
tail = nullptr;
delete temp;
}
}
void insert(T value, size_t pos) {
if (pos >= size || pos < 0)
throw std::out_of_range("Out of range exception");
size_t i = 0;
Node *insertion_node = head;
if (pos == 0)
push_front(value);
else if (pos == size-1)
push_back(value);
else {
// Iterate through list to the node before one at pos
while (i < pos - 1) {
insertion_node = insertion_node->next;
i++;
}
// Insert new node at pos
Node *temp = new Node(value, insertion_node, insertion_node->next);
insertion_node->next = temp;
size++;
}
}
T at(size_t pos) {
if (pos >= size || pos < 0)
throw std::out_of_range("Out of range exception");
size_t i = 0;
Node *temp = head;
// Iterate through list to the node at pos
while (i < pos) {
temp = temp->next;
i++;
}
return temp->data;
}
void remove(size_t pos) {
if (pos >= size || pos < 0)
throw std::out_of_range("Out of range exception");
size_t i = 0;
Node *temp = head;
// Iterate through list to the node at pos
while (i < pos) {
temp = temp->next;
i++;
}
if (temp == head) {
if (!isEmpty())
size--;
head = head->next;
head->prev = nullptr;
delete temp;
} else if (temp == tail) {
if (!isEmpty())
size--;
tail = tail->prev;
tail->next = nullptr;
delete temp;
} else {
size--;
temp->prev->next = temp->next;
temp->next->prev = temp->prev;
delete temp;
}
}
size_t get_size() {
return size;
}
void print_to_console() {
Node *temp = head;
while (temp) {
std::cout << temp->data << " ";
temp = temp->next;
}
std::cout << std::endl;
}
void clear() {
while (head)
pop_front();
size = 0;
}
void set(size_t pos, T value) {
if (pos >= size || pos < 0)
throw std::out_of_range("Out of range exception");
size_t i = 0;
Node *temp = head;
// Iterate through list to the node at pos
while (i < pos) {
temp = temp->next;
i++;
}
// If trying to access list at not existing index, throw an exception
temp->data = value;
}
size_t find_first(List sublist) {
const size_t list_s = this->get_size();
const size_t sublist_s = sublist.get_size();
// If sublist is longer than list to be searched, return error code
if (sublist_s > list_s || sublist.isEmpty() || this->isEmpty())
return -1;
size_t i = 0; // Index of first appearance of sublist
Node *node = head;
// Iterate through list excluding last sublist_s - 1 elements
while (i <= list_s - sublist_s) {
Node *temp = node; // Creating temp node of main list
size_t sublist_i = 0; // Creating counter for sublist
while (sublist_i < sublist_s && temp->data == sublist.at(sublist_i)) {
temp = temp->next;
sublist_i++;
}
if (sublist_i == sublist_s)
return i;
i++;
node = node->next;
}
return -1;
}
bool isEmpty() {
return this->head == nullptr;
}
};
template<typename T>
class Queue {
private:
// Defining nested class describing node
class Node {
public:
T data;
Node *prev, *next;
// A constructor for Node class
explicit Node(T value) : data(value), prev(nullptr), next(nullptr) {}
Node(T value, Node* prev, Node* next) : data(value), prev(prev), next(next) {}
};
size_t size;
Node *head, *tail;
public:
// A default constructor for List class
Queue() : head(nullptr), tail(nullptr), size(0) {}
~Queue() {
this->clear();
}
void enqueue(T value) {
Node *temp = new Node(value);
if (!isEmpty()) {
temp->prev = tail;
tail->next = temp;
tail = temp;
size++;
} else {
head = temp;
tail = temp;
size++;
}
}
void dequeue() {
Node *temp = head;
if (head != tail) {
head = head->next;
head->prev = nullptr;
delete temp;
size--;
} else {
if (!isEmpty())
size--;
head = nullptr;
tail = nullptr;
delete temp;
}
}
T front(){
if (this->head == nullptr)
throw std::out_of_range("Queue is empty");
return this->head->data;
}
size_t get_size() {
return size;
}
bool isEmpty() {
return this->head == nullptr;
}
void clear() {
while (head)
dequeue();
size = 0;
}
};
#endif
|
#include "../Include/Bezier.h"
Bezier::Bezier()
:count(10000)
{
}
bool Bezier::isGrabbed(int x, int y)
{
VECTOR c[4];//此矩阵是P和M的积,就是控制点阵和Bezier基矩阵的乘积
for (int i = 0; i<2; i++)
{
c[3][i] = (0 - points[0][i]) + 3 * points[1][i] - 3 * points[2][i] + points[3][i];
c[2][i] = 3 * points[0][i] - 6 * points[1][i] + 3 * points[2][i];
c[1][i] = (0 - 3 * points[0][i]) + 3 * points[1][i];
c[0][i] = points[0][i];
}
GLfloat v[2];
GLfloat newV[2];
GLfloat deltat = 1.0 / count;
GLfloat t = 0.0;
v[0] = points[0][0]; v[1] = points[0][1];
for (int i = 0; i<count; i++)//绘制最终结果
{
t += deltat;
newV[0] = c[0][0] + t*(c[1][0] + t*(c[2][0] + t*c[3][0]));
newV[1] = c[0][1] + t*(c[1][1] + t*(c[2][1] + t*c[3][1]));
glVertex2fv(v);
glVertex2fv(newV);
v[0] = newV[0]; v[1] = newV[1];
if (v[0] - 5 < x && x < v[0] + 5) {
if (v[1] - 5 < y && y < v[1] + 5) {
return true;
}
}
}
return false;
}
void Bezier::setRefPoint(int x, int y,int num)
{
points[num][0] = x;
points[num][1] = y;
}
inline void Bezier::draw()
{
applyColor();
applyLineWidth();
VECTOR c[4];//此矩阵是P和M的积,就是控制点阵和Bezier基矩阵的乘积
for (int i = 0; i<2; i++)
{
c[3][i] = (0 - points[0][i]) + 3 * points[1][i] - 3 * points[2][i] + points[3][i];
c[2][i] = 3 * points[0][i] - 6 * points[1][i] + 3 * points[2][i];
c[1][i] = (0 - 3 * points[0][i]) + 3 * points[1][i];
c[0][i] = points[0][i];
}
GLfloat v[2];
GLfloat newV[2];
GLfloat deltat = 1.0 / count;
GLfloat t = 0.0;
glBegin(GL_LINES);
v[0] = points[0][0]; v[1] = points[0][1];
for (int i = 0; i<count; i++)//绘制最终结果
{
t += deltat;
newV[0] = c[0][0] + t*(c[1][0] + t*(c[2][0] + t*c[3][0]));
newV[1] = c[0][1] + t*(c[1][1] + t*(c[2][1] + t*c[3][1]));
glVertex2fv(v);
glVertex2fv(newV);
v[0] = newV[0]; v[1] = newV[1];
}
glEnd();
// glFlush();x
}
void Bezier::move(int x, int y)
{
for (int i = 0; i < 4; i++) {
points[i][0] += x;
points[i][1] += y;
}
}
void Bezier::setEndPos(int x, int y)
{
}
Point Bezier::getRefPoint(int num)
{
Point tmp;
tmp.x = points[num][0];
tmp.y = points[num][1];
return tmp;
}
|
#include <iostream>
#include <string>
#include <string.h>
using namespace std;
//get command from player on console
class InputCmd {
public:
string Entry;
string Cmd;
string Attribute;
void ReadEntry() {
getline(cin, Entry);
//cout << Entry << endl;
};
void GetValues() { cout << "getvalues" << endl; };
};
//Room values
class Room {
public:
int i;
int j;
string Description;
};
//control for ubication on map
class ubication{
public:
Room Room;
int dir;
string Ubication;
void IniVal() {
Room.i = 0;
Room.j = 0;
dir = 0;
};
void Move(int dir){
if (dir==1 && Room.i >= 0 && Room.i<=1) {
cout << "You Move to right position" << endl;
Room.i++;
}
else if (dir == 2 && Room.i >= 1 && Room.i <= 2) {
cout << "You Move to left position" << endl;
Room.i--;
}
else if (dir == 3 && Room.j >= 0 && Room.j <= 1) {
cout << "You Move to up position" << endl;
Room.j++;
}
else if (dir == 4 && Room.j >= 1 && Room.j <= 2) {
cout << "You Move to down position" << endl;
Room.j--;
}
else cout << "you can't move on that direction" << endl;
//cout << Room.i << Room.j << endl;
};
void DispUbication() {
if (Room.i == 0 && Room.j == 0) {
Ubication = "Room of fungi";
};
if (Room.i == 1 && Room.j == 0) {
Ubication = "Room of water";
};
if (Room.i == 2 && Room.j == 0) {
Ubication = "Room of despair";
};
if (Room.i == 0 && Room.j == 1) {
Ubication = "Room of glory";
};
if (Room.i == 1 && Room.j == 1) {
Ubication = "Room of peace";
};
if (Room.i == 2 && Room.j == 1) {
Ubication = "Room of fear";
};
if (Room.i == 0 && Room.j == 3) {
Ubication = "Room of knowledge";
};
if (Room.i == 1 && Room.j == 3) {
Ubication = "Room of spacy";
};
if (Room.i == 2 && Room.j == 3) {
Ubication = "Room of final boss";
};
cout << "you are in room :" <<Ubication << endl;
};
};
class Player : public ubication, public InputCmd{
};
int main()
{
std::cout << "This is Eymard's World, right now you are in Yuggoth!\n";
Player Plyr;//define player
Plyr.IniVal();//initialize values for execution
//read comand from console
while (1) {
Plyr.ReadEntry();
if (Plyr.Entry.compare("move right") == 0) {
Plyr.Move(1);//move to righth
}
else if (Plyr.Entry.compare("move left") == 0) {
Plyr.Move(2);//move to left
}
else if (Plyr.Entry.compare("move up") == 0) {
Plyr.Move(3);//move to up
}
else if (Plyr.Entry.compare("move down") == 0) {
Plyr.Move(4);//move to down
}
else {};
Plyr.DispUbication();
};
};
|
#include "mainwindow.h"
#include "ui_mainwindow.h"
static Stack< int> stack{};
static int i = 0;
static string answer{};
static string inputTest{};
static string err{};
static string postfixForm;
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_result_clicked()
{
string result, postfixForm, error;
string str = ui->input->text().toUtf8().constData();
toPostfixForm(str, postfixForm, error);
if(!error.empty()){
ui->output->setText(QString::fromStdString(error));
return;
}
int ans = calc(postfixForm, result, err);
string str1 = "Результат вычислений: ";
if(!err.empty())
str1 += err;
else
str1 += to_string(ans);
ui->output->setText(QString::fromStdString(str1));
}
void MainWindow::on_step_clicked()
{
string str = ui->input->text().toUtf8().constData(), error;
if(inputTest.compare(str)!=0){
i=0;
answer.clear();
err.clear();
inputTest.clear();
inputTest.append(str);
toPostfixForm(str, postfixForm, error);
if(!error.empty()){
ui->output->setText(QString::fromStdString(error));
return;
}
ui->output->clear();
stack.clear();
stack.setSize(postfixForm.length());
}
if(!err.empty()){
return;
}
if(i>=postfixForm.length() && stack.length()==1){
i=0;
stack.pop();
answer.clear();
err.clear();
}
onestep(postfixForm[i], stack, answer, err);
i++;
if(answer.empty()){
ui->output->setText(QString::fromStdString(err));
}
else if(err.empty()){
ui->output->setText(QString::fromStdString(answer));
}
else{
ui->output->setText(QString::fromStdString(answer)+QString::fromStdString(err));
}
}
void MainWindow::on_dataFromFile_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open TXT File"), QDir::homePath(),
tr("TXT text (*.txt);;All Files (*)"));
ifstream sourceFile(fileName.toUtf8().constData());
string input;
sourceFile >> input;
ui->input->setText(QString::fromStdString(input));
}
void MainWindow::on_saveOutput_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this,
tr("Open TXT File"), QDir::homePath(),
tr("TXT text (*.txt);;All Files (*)"));
ofstream sourceFile(fileName.toUtf8().constData());
sourceFile << ui->output->toPlainText().toUtf8().constData();
}
|
// CkBounce.h: interface for the CkBounce class.
//
//////////////////////////////////////////////////////////////////////
// This header is generated.
#ifndef _CkBounce_H
#define _CkBounce_H
#include "chilkatDefs.h"
#include "CkString.h"
#include "CkMultiByteBase.h"
class CkEmail;
#ifndef __sun__
#pragma pack (push, 8)
#endif
// CLASS: CkBounce
class CkBounce : public CkMultiByteBase
{
private:
// Don't allow assignment or copying these objects.
CkBounce(const CkBounce &);
CkBounce &operator=(const CkBounce &);
public:
CkBounce(void);
virtual ~CkBounce(void);
static CkBounce *createNew(void);
void inject(void *impl);
// May be called when finished with the object to free/dispose of any
// internal resources held by the object.
void dispose(void);
// BEGIN PUBLIC INTERFACE
// ----------------------
// Properties
// ----------------------
void get_BounceAddress(CkString &str);
const char *bounceAddress(void);
void get_BounceData(CkString &str);
const char *bounceData(void);
int get_BounceType(void);
// ----------------------
// Methods
// ----------------------
bool ExamineEmail(const CkEmail &email);
bool ExamineEml(const char *emlPath);
bool ExamineMime(const char *mimeString);
bool UnlockComponent(const char *unlockCode);
// END PUBLIC INTERFACE
};
#ifndef __sun__
#pragma pack (pop)
#endif
#endif
|
#include<bits/stdc++.h>
using namespace std;
int getcount(vector<int>& arr,int n)
{
int count = 0;
for(int i=1;i<=n-2;i++)
{
if((arr[i] > arr[i-1] && arr[i] > arr[i+1]) || (arr[i] < arr[i-1] && arr[i] < arr[i+1]))
{
count+=1;
}
}
return count;
}
int solve(vector<int>& arr,int n)
{
vector<int> store(n,0);
int count = 0;
for(int i=1;i<=n-2;i++)
{
if((arr[i-1] > arr[i] && arr[i+1] > arr[i]) || (arr[i-1] < arr[i] && arr[i+1] < arr[i]))
{
store[i]=1;
count+=1;
}
}
//cout << count << endl;
int min_value = INT_MAX;
for(int i=1;i<=n-2;i++)
{
int temp_count = count;
//change it to left
int temp = arr[i];
arr[i]=arr[i-1];
// first we will check whether cur is hill or not
if(store[i]==1)
{
temp_count-=1;
}
// we will check the left one
if(store[i-1]==1)
{
temp_count-=1;
}
//check right one
if( i+2 < n && ((arr[i+2] < arr[i+1] && arr[i] < arr[i+1]) || (arr[i+2] > arr[i+1] && arr[i] > arr[i+1])))
{
temp_count+=1;
}
if(store[i+1]==1)
{
temp_count-=1;
}
min_value = min(min_value,temp_count);
// change it to right
temp_count = count;
arr[i]=arr[i+1];
// first we will check whether cur is hill or not
if(store[i]==1)
{
temp_count-=1;
}
// we will check the right one
if(store[i+1]==1)
{
temp_count-=1;
}
//check the left one
if( i-2 >=0 && ((arr[i] < arr[i-1] && arr[i-2] < arr[i-1]) || (arr[i] > arr[i-1] && arr[i-2] > arr[i-1])))
{
temp_count+=1;
}
if(store[i-1]==1)
{
temp_count-=1;
}
min_value = min(min_value,temp_count);
arr[i]=temp;
//cout << arr[i] << " " << min_value << endl;
}
return min_value;
}
int main()
{
int t;
cin >> t;
while(t--)
{
int n;
cin >> n;
vector<int> arr(n);
for(int i=0;i<n;i++)
{
cin >> arr[i];
}
cout << solve(arr,n) << endl;
}
return 0;
}
|
#include <iostream>
using namespace std;
int main() {
char drink[3][11] = { "Americano", "Cafe Latte", "Lemon Tea" };
int money[3] = { 500, 400, 300 };
int N, m, cnt = 0;
cin >> N >> m;
cout << drink[N - 1] << endl;
m = m - money[N - 1];
while (m >= 500) {
m = m - 500;
cnt++;
}
cout << cnt << ' ';
cnt = 0;
while (m >= 100) {
m = m - 100;
cnt++;
}
cout << cnt;
}
|
/**
* [Question]
* - 配置された配列を反転するにはどうすればよいですか?
*
* [Solution]
* - 先頭から順にスワップを繰り返す
* - e.g. 10の配列の場合
* - 0と10をスワップ, 1と9をスワップ, 2と8をスワップ, ...
* - 単純な線形探索の半分で実装できる
*/
#include <iostream>
#include <vector>
int main()
{
/* INPUT */
std::vector<int> v = {30, 88, 7, 25, 17, 20, 100, 2, 5, 88, 17, 88, 100, 101};
/* SOLVE */
int left = 0;
int right = v.size()-1;
while (right - left >= 0)
{
std::swap(v[left], v[right]);
left++;
right--;
}
for (int i = 0; i < v.size(); i++) std::cout << v[i] << " ";
std::cout << std::endl;
return 0;
}
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while( t-- ){
int n, s;
cin >> n >> s;
int a[n];
unsigned long long sum = 0;
for(int i = 0 ; i < n ; i++){
cin >> a[i];
sum += a[i];
}
if(sum <= s){
cout <<"0\n";
continue;
}
sum = 0;
int mx = 0;
int k = 0;
while(k<n && (sum+a[k] <= s)){
sum += a[k];
k++;
if(a[k] > a[mx]){
mx = k;
}
}
int answer = k;
int cnt = 0;
sum -= a[mx];
while(k < n){
if(sum + a[k] > s)break;
sum += a[k];
k++;
cnt++;
}
if(cnt > 1){
cout << mx+1 << endl;
}
else{
cout << 0 << endl;
}
}
return 0;
}
|
#include <iostream>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <unordered_set>
class Graph {
private:
int numNodes;
public:
Graph(int num):numNodes(num){nodes = new Node[numNodes];}
class edge{
public:
edge(int n, double w=0):dst(n),weight(w){}
int dst;
double weight;
bool operator==(edge other){
return dst == other.dst;
}
};
class Node {
public:
std::vector<edge> edges;
};
Node *nodes;
Graph(const Graph& other){
numNodes = other.numNodes;
std::memcpy(nodes,other.nodes,numNodes*sizeof(other.nodes[0]));
} // copy constructor
Graph& operator=(const Graph& other){
if(this == &other) return *this;
numNodes = other.numNodes;
std::memcpy(nodes,other.nodes,numNodes*sizeof(other.nodes[0]));
return *this;
} // assignment operator
void addEdge(int v1, int v2, double w=0){
addEdgeImpl(v1,v2,w);
addEdgeImpl(v2,v1,w);
}
std::vector<edge> getAdjacentTo(int node){
return nodes[node].edges;
}
void addEdgeImpl(int v1, int v2, double w=0){
std::vector<Graph::edge> &edges = nodes[v1].edges;
if(std::find(edges.begin(),edges.end(), edge(v2)) == edges.end()){
nodes[v1].edges.push_back(edge(v2,w));
}
}
void addAdjacentTo(int node, std::vector<edge> adj){
for(edge e: adj)
addEdge(node,e.dst,e.weight);
}
};
class maze{
private:
std::vector<std::vector<char>> mazeVector;
int numNodes = 0;
int startLoc = 0;
int endLoc = 0;
void dfs_search(std::set<int> &visitedSet, int currNode){
if(visitedSet.find(currNode) == visitedSet.end()){
visitedSet.insert(currNode);
for(auto i: g.getAdjacentTo(currNode))
dfs_search(visitedSet, i.dst);
}
}
std::pair<std::map<int,int>,std::set<int>> DijkstraShortestPath(){
std::map<int,int> distanceMap;
std::map<int,int> predMap;
std::set<int> nodeSet;
std::list<int> unvisitedQueue;
dfs_search(nodeSet,startLoc);
for(auto node: nodeSet){
predMap.insert({node, 0});
distanceMap.insert({node, 999999});
unvisitedQueue.push_back(node);
}
distanceMap[startLoc] = 0; // start distance = 0;
int currentVertex = startLoc;
while(!unvisitedQueue.empty()){
// visit the node with the minimum distance from the start
int minNode = *unvisitedQueue.begin();
for(auto i:unvisitedQueue)
if(distanceMap[minNode] > distanceMap[i]) minNode = i;
currentVertex = minNode;
unvisitedQueue.remove(currentVertex);
for(auto i:g.getAdjacentTo(currentVertex)){
double edgeWeight = i.weight;
double altPath = distanceMap[currentVertex] + edgeWeight;
if(altPath < distanceMap[i.dst]){
distanceMap[i.dst] = altPath;
predMap[i.dst] = currentVertex;
}
}
}
return {predMap,nodeSet};
}
public:
Graph &g;
maze(std::vector<std::vector<char>> vect) : mazeVector(vect), g(*(new Graph(0))){};
void trim(){
int firstRowSize = mazeVector[0].size();
std::vector<std::vector<char>> trimmedMaze;
for(auto & mazeElement : mazeVector){
std::vector<char> tempVect;
for(int j=0; j<firstRowSize; j++){
tempVect.push_back(mazeElement[j]);
}
trimmedMaze.push_back(tempVect);
}
mazeVector = trimmedMaze;
}
void print(){
for(auto & mazeRow : mazeVector) {
for (char mazeElement : mazeRow){
auto mazeEdges = g.getAdjacentTo(startLoc);
std::cout << mazeElement;
}
std::cout << std::endl;
}
}
void convertToGraph() { // return maze graph
g = *(new Graph((int) (mazeVector.size() * mazeVector[0].size())));
int width = mazeVector[0].size();
for (int i = 0; i < mazeVector.size(); i++) {
for (int j = 0; j < mazeVector[i].size(); j++) {
int loc = i * width + j;
if (mazeVector[i][j] == 's' && !startLoc) {
startLoc = loc;
if (j < mazeVector[0].size() && mazeVector[i][j + 1] == ' ') {
g.addAdjacentTo(loc, {{loc + 1, 1}});
} // space to the right
if (j > 0 && mazeVector[i][j - 1] == ' ') {
g.addAdjacentTo(loc, {{loc - 1, 1}});
} // space to the left
if (i > 0 && mazeVector[i - 1][j] == ' ') {
g.addAdjacentTo(loc, {{loc - width, 1}});
} // space above
if (i < mazeVector.size() && mazeVector[i + 1][j] == ' ') {
g.addAdjacentTo(loc, {{loc + width, 1}});
} // space below
if (i > 0 && j > 0 && mazeVector[i - 1][j - 1] == ' ') {
g.addAdjacentTo(loc, {{loc - width - 1, 1.41}});
} // space top left
if (i > 0 && j < mazeVector[0].size() && mazeVector[i - 1][j + 1] == ' ') {
g.addAdjacentTo(loc, {{loc - width + 1, 1.41}});
} // space top right
if (i < mazeVector.size() && j > 0 && mazeVector[i + 1][j - 1] == ' ') {
g.addAdjacentTo(loc, {{loc + width - 1, 1.41}});
} // space bottom left
if (i < mazeVector.size() && j < mazeVector[i].size() && mazeVector[i + 1][j + 1] == ' ') {
g.addAdjacentTo(loc, {{loc + width + 1, 1.41}});
} // space bottom right
numNodes++;
}
if (mazeVector[i][j] == ' ') {
if (j < mazeVector[0].size() && mazeVector[i][j + 1] == ' ') {
g.addAdjacentTo(loc, {{loc + 1, 1}});
} // space to the right
if (j > 0 && mazeVector[i][j - 1] == ' ') {
g.addAdjacentTo(loc, {{loc - 1, 1}});
} // space to the left
if (i > 0 && mazeVector[i - 1][j] == ' ') {
g.addAdjacentTo(loc, {{loc - width, 1}});
} // space above
if (i < mazeVector.size() && mazeVector[i + 1][j] == ' ') {
g.addAdjacentTo(loc, {{loc + width, 1}});
} // space below
if (i > 0 && j > 0 && mazeVector[i - 1][j - 1] == ' ') {
g.addAdjacentTo(loc, {{loc - width - 1, 1.41}});
} // space top left
if (i > 0 && j < mazeVector[0].size() && mazeVector[i - 1][j + 1] == ' ') {
g.addAdjacentTo(loc, {{loc - width + 1, 1.41}});
} // space top right
if (i < mazeVector.size() && j > 0 && mazeVector[i + 1][j - 1] == ' ') {
g.addAdjacentTo(loc, {{loc + width - 1, 1.41}});
} // space bottom left
if (i < mazeVector.size() && j < mazeVector[i].size() && mazeVector[i + 1][j + 1] == ' ') {
g.addAdjacentTo(loc, {{loc + width + 1, 1.41}});
} // space bottom right
numNodes++;
}
if (mazeVector[i][j] == 'e') {
endLoc = loc;
if (j < mazeVector[0].size() && mazeVector[i][j + 1] == ' ') {
g.addAdjacentTo(loc, {{loc + 1, 1}});
} // space to the right
if (j > 0 && mazeVector[i][j - 1] == ' ') {
g.addAdjacentTo(loc, {{loc - 1, 1}});
} // space to the left
if (i > 0 && mazeVector[i - 1][j] == ' ') {
g.addAdjacentTo(loc, {{loc - width, 1}});
} // space above
if (i < mazeVector.size() && mazeVector[i + 1][j] == ' ') {
g.addAdjacentTo(loc, {{loc + width, 1}});
} // space below
if (i > 0 && j > 0 && mazeVector[i - 1][j - 1] == ' ') {
g.addAdjacentTo(loc, {{loc - width - 1, 1.41}});
} // space top left
if (i > 0 && j < mazeVector[0].size() && mazeVector[i - 1][j + 1] == ' ') {
g.addAdjacentTo(loc, {{loc - width + 1, 1.41}});
} // space top right
if (i < mazeVector.size() && j > 0 && mazeVector[i + 1][j - 1] == ' ') {
g.addAdjacentTo(loc, {{loc + width - 1, 1.41}});
} // space bottom left
if (i < mazeVector.size() && j < mazeVector[i].size() && mazeVector[i + 1][j + 1] == ' ') {
g.addAdjacentTo(loc, {{loc + width + 1, 1.41}});
} // space bottom right
numNodes++;
}
}
}
}
void outputShortestPath(){
auto test = DijkstraShortestPath();
int testLoc = endLoc;
std::set<int> nodeSet = test.second;
std::map<int,int> predMap = test.first;
std::unordered_set<int> pathHash;
while(testLoc != startLoc){
pathHash.insert(predMap[testLoc]);
testLoc = predMap[testLoc];
}
std::cout << std::endl;
for(int i=0; i<mazeVector.size(); i++){
for (int j=0; j<mazeVector[0].size(); j++){
if((pathHash.find(i*mazeVector[0].size()+j) != pathHash.end()) && mazeVector[i][j] != 's')
std::cout << "*";
else
std::cout << mazeVector[i][j];
}
std::cout << std::endl;
}
}
bool getInput{
};
};
int main(int argc, char **argv) {
// command line argument check
if(argc>1){
std::cout << "Jackson Thomas jpthoma6@ncsu.edu" << std::endl;
return 0;
}
// input
std::vector<std::vector<char>> inputMaze;
std::string temp;
while(true){
std::getline(std::cin, temp);
if(temp.empty()) break;
std::vector<char> tempVect;
for(char & vectChar : temp) {
tempVect.push_back(vectChar);
}
inputMaze.push_back(tempVect);
}
maze userVect(inputMaze); // create a maze from the input
if(inputMaze.empty()) return 0; // check if nothing is entered
if(inputMaze.size() == 1){
userVect.print();
return 0;
} // check if one character is entered
// output
userVect.trim();
userVect.convertToGraph();
userVect.outputShortestPath();
return 0;
}
|
#include "CheckBoxLabel.h"
#include <QDebug>
CheckBoxLabel::CheckBoxLabel(int width, int height, const QImage &falseImage, const QImage &trueImage, bool startState, QWidget *parent):
QLabel(parent), m_imageFalse(falseImage), m_imageTrue(trueImage), m_state(startState)
{
this->setFixedSize(width, height);
updatePixmap();
}
CheckBoxLabel::~CheckBoxLabel()
{
}
bool CheckBoxLabel::getState() const
{
return m_state;
}
void CheckBoxLabel::mousePressEvent(QMouseEvent *ev)
{
Q_UNUSED(ev)
m_state = ! m_state;
updatePixmap();
}
void CheckBoxLabel::updatePixmap()
{
if (m_state)
this->setPixmap(QPixmap::fromImage(m_imageTrue.scaled(this->size(),Qt::KeepAspectRatio)));
else
this->setPixmap(QPixmap::fromImage(m_imageFalse.scaled(this->size(),Qt::KeepAspectRatio)));
}
|
// COMPETITION TIME OVER!!
//TLE
#include <bits/stdc++.h>
using namespace std;
map<string, int> m;
string helper(string s, int n)
{
if (s.length() > n)
return s;
if (s.length() == n)
{
if (m.find(s) != m.end())
m.insert(make_pair(s, 1));
}
vector<char> input{'a', 'b', 'c'};
if (s.size() == 0)
{
for (char c : input)
helper(s + c, n);
}
else
{
int n = s.length();
for (int i = 0; i < 3; i++)
{
if (s[n - 1] == input[i])
{
input.erase(input.begin() + i);
for (char c : input)
helper(s + c, n);
input.push_back(s[n - 1]);
}
}
}
}
string getHappyString(int n, int k)
{
helper("", n);
auto itr = m.begin();
while (k--)
itr++;
return itr->first;
}
int main()
{
return 0;
}
|
#include <iostream>
#include <gtest/gtest.h>
#include "hs_math/random/normal_random_var.hpp"
#include "hs_math/random/uniform_random_var.hpp"
#include "hs_sfm/sfm_utility/similar_transform_estimator.hpp"
namespace
{
template <typename _Scalar>
class TestSimilarTransformEstimator
{
public:
typedef _Scalar Scalar;
typedef int Err;
private:
typedef hs::sfm::SimilarTransformEstimator<Scalar> Estimator;
typedef typename Estimator::Point Point;
typedef typename Estimator::PointContainer PointContainer;
public:
typedef typename Estimator::Rotation Rotation;
typedef typename Estimator::Translate Translate;
public:
TestSimilarTransformEstimator(
size_t number_of_points,
Scalar stddev,
const Rotation& rotation_prior,
const Translate& translate_prior,
Scalar scale_prior)
: number_of_points_(number_of_points),
stddev_(stddev),
rotation_prior_(rotation_prior),
translate_prior_(translate_prior),
scale_prior_(scale_prior) {}
public:
Err Test()
{
Point rel_point_min;
rel_point_min << -1,
-1,
-1;
Point rel_point_max = -rel_point_min;
PointContainer rel_points_true(number_of_points_);
for (size_t i = 0; i < number_of_points_; i++)
{
hs::math::random::UniformRandomVar<Scalar, 3>::Generate(
rel_point_min, rel_point_max, rel_points_true[i]);
}
PointContainer abs_points_true(number_of_points_);
for (size_t i = 0; i < number_of_points_; i++)
{
Point rel_point = rel_points_true[i];
abs_points_true[i] = scale_prior_ * (rotation_prior_ * rel_point) +
translate_prior_;
}
typedef EIGEN_MATRIX(Scalar, 3, 3) PointCovariance;
PointCovariance rel_covariance = PointCovariance::Identity();
PointCovariance abs_covariance = PointCovariance::Identity();
rel_covariance *= stddev_ * stddev_ / scale_prior_ / scale_prior_;
abs_covariance *= stddev_ * stddev_;
PointContainer rel_points_noised = rel_points_true;
PointContainer abs_points_noised = abs_points_true;
for (size_t i = 0; i < number_of_points_; i++)
{
hs::math::random::NormalRandomVar<Scalar, 3>::Generate(
rel_points_true[i], rel_covariance, rel_points_noised[i]);
hs::math::random::NormalRandomVar<Scalar, 3>::Generate(
abs_points_true[i], abs_covariance, abs_points_noised[i]);
}
Rotation rotation_estimate;
Translate translate_estimate;
Scalar scale_estimate;
Estimator estimator;
if (estimator(rel_points_noised, abs_points_noised,
rotation_estimate,
translate_estimate,
scale_estimate) != 0)
{
return -1;
}
PointContainer abs_points_estimate = rel_points_noised;
for (size_t i = 0; i < number_of_points_; i++)
{
Point rel_point = rel_points_noised[i];
abs_points_estimate[i] =
scale_estimate * (rotation_estimate * rel_point) + translate_estimate;
}
Scalar mean_error = Scalar(0);
for (size_t i = 0; i < number_of_points_; i++)
{
Point diff = abs_points_estimate[i] - abs_points_noised[i];
Scalar error = diff.norm();
mean_error += error;
}
mean_error /= Scalar(number_of_points_);
Scalar threshold = stddev_ * 2 + 1;
if (mean_error > threshold)
{
return -1;
}
return 0;
}
private:
size_t number_of_points_;
Scalar stddev_;
Rotation rotation_prior_;
Translate translate_prior_;
Scalar scale_prior_;
};
TEST(TestSimilarTransformEstimator, SimpleTest)
{
typedef double Scalar;
typedef TestSimilarTransformEstimator<Scalar> Tester;
typedef EIGEN_MATRIX(Scalar, 3, 3) Matrix33;
typedef Tester::Rotation Rotation;
typedef Tester::Translate Translate;
size_t number_of_points = 100;
Scalar stddev = 0.5;
Matrix33 rotation_matrix;
rotation_matrix << 0.5399779, -0.8415759, 0.0131819,
0.8411558, 0.5401282, 0.0268019,
-0.0296757, -0.0033843, 0.9995538;
Rotation rotation_prior(rotation_matrix);
Translate translate_prior;
translate_prior << 22.067653670014472,
-115.69362180617838,
488.11969428744248;
Scalar scale_prior = 180.83981053672068;
Tester tester(number_of_points,
stddev,
rotation_prior,
translate_prior,
scale_prior);
ASSERT_EQ(0, tester.Test());
}
TEST(TestSimilarTransformEstimator, PriorTest)
{
typedef double Scalar;
typedef hs::sfm::SimilarTransformEstimator<Scalar> Estimator;
typedef Estimator::Point Point;
typedef Estimator::PointContainer PointContainer;
typedef Estimator::Rotation Rotation;
typedef Estimator::Translate Translate;
PointContainer points_1(4);
PointContainer points_2(4);
points_2[0] << 2614304.862,
404783.446,
116.810;
points_2[1] << 2611325.079,
405029.381,
117.931;
points_2[2] << 2615611.506,
411900.269,
131.823;
points_2[3] << 2611160.858,
413763.796,
108.580;
points_1[0] << 2614108.822,
557851.217,
116.810;
points_1[1] << 2611131.991,
558128.369,
117.931;
points_1[2] << 2615490.009,
564953.528,
131.823;
points_1[3] << 2611059.331,
566863.561,
108.580;
Estimator estimator;
Rotation rotation_similar;
Translate translate_similar;
Scalar scale_similar;
ASSERT_EQ(0, estimator(points_1, points_2,
rotation_similar,
translate_similar,
scale_similar));
for (size_t i = 0; i < 4; i++)
{
Point point_2_estimate = points_1[i];
point_2_estimate = rotation_similar * point_2_estimate;
point_2_estimate = scale_similar * point_2_estimate;
point_2_estimate = point_2_estimate + translate_similar;
Point diff = point_2_estimate - points_2[i];
int bp = 0;
}
}
}
|
#include "DeferredRenderingApplication.h"
#include "Controls.h"
#include "LightsAnimator.h"
#include <FastCG/World/GameObjectLoader.h>
#include <FastCG/World/ComponentRegistry.h>
#include <FastCG/Assets/AssetSystem.h>
#include <vector>
#include <cstdint>
using namespace FastCG;
DeferredRenderingApplication::DeferredRenderingApplication() : Application({"deferred_rendering", 1024, 768, 60, 3, false, {RenderingPath::DEFERRED}, {{"deferred_rendering"}}})
{
ComponentRegistry::RegisterComponent<Controls>();
ComponentRegistry::RegisterComponent<LightsAnimator>();
}
void DeferredRenderingApplication::OnStart()
{
GameObjectLoader::Load(AssetSystem::GetInstance()->Resolve("scenes/deferred_rendering.scene"));
}
|
#include "Scene.h"
#include "Parser.h"
Scene::Scene(): CGFscene(){
}
void Scene::init()
{
attributes = new Attributes();
/*string filename;
cout << "Insert the ANF filename: " << endl;
cin >> filename;
Parser teste = Parser(filename.c_str(), attributes);
*/
Parser teste = Parser("textures/pingpong.anf", attributes);
attributes->processglobals();
attributes->createDisplay(attributes->getRoot(), NULL);
/*
plane = new Plane(2);
float * points = new float[27];
points[0] = 0.0;
points[1] = 0.0;
points[2] = 0.0;
points[3] = 0.0;
points[4] = 2.0;
points[5] = -1.0;
points[6] = 0.0;
points[7] = 3.0;
points[8] = -1.5;
points[9] = 0.0;
points[10] = 2.0;
points[11] = -2.0;
points[12] = 0.0;
points[13] = 0.0;
points[14] = -3.0;
points[15] = 4.0;
points[16] = 0.0;
points[17] = 0.0;
points[18] = 4.0;
points[19] = 2.0;
points[20] = -1.0;
points[21] = 4.0;
points[22] = 2.0;
points[23] = -1.0;
points[24] = 4.0;
points[25] = 0.0;
points[26] = -3.0;
/*{
{0.0,0.0,0.0},{0.0,2.0,-1.0},{0.0,2.0,-2.0},{0.0,0.0,-3.0},
{4.0,0.0,0.0},{4.0,2.0,-1.0},{4.0,2.0,-2.0},{4.0,0.0,-3.0}};*/
/*
patch = new Patch(2, 5, 5, points, "fill");
*/
/*vehicle = new Vehicle();
vector<float> X;
X.push_back(0.0);
X.push_back(0.0);
X.push_back(5.0);
vector<float> Y;
Y.push_back(0.0);
Y.push_back(0.0);
Y.push_back(0.0);
vector<float> Z;
Z.push_back(5.0);
Z.push_back(0.0);
Z.push_back(0.0);
float * c = new float[3]();
c[0] = 2;
c[1] = 2;
c[2] = 2;
animation = new CircularAnimation("lol",5,c,10,0,90);*/
setUpdatePeriod(30);
}
void Scene::update(unsigned long t)
{
//update node
attributes->updateAnimationsNodes(t);
}
void Scene::display()
{
// ---- BEGIN Background, camera and axis setup
// Clear image and depth buffer everytime we update the scene
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
// Initialize Model-View matrix as identity (no transformation
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
//Associate texture to appearance
chooseDrawing();
chooseCamera();
// Draw (and update) light
attributes->drawlights();
// Draw axis
axis.draw();
// ---- END Background, camera and axis setup
// ---- BEGIN feature demos
attributes->processnodes(attributes->getRoot(),NULL);
//plane->draw(attributes->getTexture()["mesaText"], attributes->getAppearances()["mesaApp"]);
//patch->draw(attributes->getTexture()["redeText"], attributes->getAppearances()["redeApp"]);
/*glPushMatrix();
animation->apply();
vehicle->draw(attributes->getTexture()["redeText"], attributes->getAppearances()["mesaApp"]);
glPopMatrix();*/
// ---- END feature demos
// We have been drawing in a memory area that is not visible - the back buffer,
// while the graphics card is showing the contents of another buffer - the front buffer
// glutSwapBuffers() will swap pointers so that the back buffer becomes the front buffer and vice-versa
glutSwapBuffers();
}
Scene::~Scene()
{
}
void Scene::chooseDrawing(){
if(this->drawingId == 0){
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
}
else if(this->drawingId == 1){
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
}
}
void Scene::applyCamera(){
activeCamera = this->attributes->getCameras()[attributes->getInitialCamera()];
CGFapplication::activeApp->forceRefresh();
this->attributes->getCameras()[attributes->getInitialCamera()]->applyView();
}
void Scene::chooseCamera(){
if(this->cameraId == 0)
{
this->initCameras();
glLoadIdentity();
this->activeCamera->applyView();
}
else{
this->attributes->cameraById(this->cameraId);
applyCamera();
}
}
Attributes * Scene::getAttributes(){
return this->attributes;
}
void Scene::resetanimations(){
attributes->resetAnimations();
}
|
//
// GameWorld.h
// PaperBounce3
//
// Created by Chaim Gingold on 9/9/16.
//
//
#ifndef GameWorld_h
#define GameWorld_h
#include <memory>
#include "cinder/Xml.h"
#include "cinder/PolyLine.h"
#include "Contour.h"
#include "Vision.h"
class Pipeline;
class GameWorld
{
public:
virtual string getSystemName() const { return "GameWorld"; } // for xml param block name
void setVisionParams( Vision::Params p ) { mVisionParams=p; }
Vision::Params getVisionParams() const { return mVisionParams; }
// app automatically loads xml params for GameWorld and sets them.
// it then gets them when they are needed.
virtual void setParams( XmlTree ){}
virtual void updateContours( const ContourVector &c ){} // called 1st
virtual void updateCustomVision( Pipeline& ){} // called 2nd
void setWorldBoundsPoly( PolyLine2 p ) { mWorldBoundsPoly=p; worldBoundsPolyDidChange(); }
PolyLine2 getWorldBoundsPoly() const { return mWorldBoundsPoly; }
virtual void worldBoundsPolyDidChange(){}
vec2 getRandomPointInWorldBoundsPoly() const; // a little lamely special case;
// might be more useful to have something like random point on contour,
// and then pick whether you want a hole or not hole.
// randomPointOnContour()
virtual void gameWillLoad(){}
virtual void update(){}
virtual void draw( bool highQuality ){}
// because mice, etc... do sometimes touch these worlds...
// all positions in world space
virtual void drawMouseDebugInfo( vec2 ){}
virtual void mouseClick( vec2 ){}
virtual void keyDown( KeyEvent ){}
private:
Vision::Params mVisionParams;
PolyLine2 mWorldBoundsPoly;
};
class GameCartridge
{
public:
virtual shared_ptr<GameWorld> load() const { return 0; }
};
class GameCartridgeSimple : public GameCartridge
{
public:
typedef function< std::shared_ptr<GameWorld>() > tLoaderFunc;
GameCartridgeSimple( tLoaderFunc f ) {mLoader=f;}
virtual std::shared_ptr<GameWorld> load() const override
{
if (mLoader) return mLoader();
else return 0;
}
private:
tLoaderFunc mLoader;
};
#endif /* GameWorld_h */
|
#include <particle_structs.hpp>
#include <ppTiming.hpp>
#include "perfTypes.hpp"
#include "../particle_structs/test/Distribute.h"
PS* createSCS(int num_elems, int num_ptcls, kkLidView ppe, kkGidView elm_gids, int C, int sigma, int V);
PS* createCSR(int num_elems, int num_ptcls, kkLidView ppe, kkGidView elm_gids);
int main(int argc, char* argv[]) {
Kokkos::initialize(argc, argv);
MPI_Init(&argc, &argv);
/* Check commandline arguments */
int test_num;
if(argc == 5){
test_num = atoi(argv[4]);
}
else if (argc != 4) {
fprintf(stderr, "Usage: %s <num elems> <num ptcls> <distribution> <optional: test_num>\n",
argv[0]);
}
fprintf(stderr, "Test Command:\n %s %s %s %s ", argv[0], argv[1], argv[2], argv[3]);
if(argc == 5)
fprintf(stderr, "%s\n", argv[4]);
else
fprintf(stderr, "\n");
/* Enable timing on every process */
pumipic::SetTimingVerbosity(0);
{
/* Create initial distribution of particles */
int num_elems = atoi(argv[1]);
int num_ptcls = atoi(argv[2]);
int strat = atoi(argv[3]);
kkLidView ppe("ptcls_per_elem", num_elems);
kkGidView element_gids("",0);
int* ppe_host = new int[num_elems];
std::vector<int>* ids = new std::vector<int>[num_elems];
distribute_particles(num_elems, num_ptcls, strat, ppe_host, ids);
pumipic::hostToDevice(ppe, ppe_host);
delete [] ppe_host;
delete [] ids;
/* Create particle structure */
ParticleStructures structures;
if(argc == 5){
switch(test_num){
case 0:
structures.push_back(std::make_pair("Sell-32-ne",
createSCS(num_elems, num_ptcls, ppe, element_gids,
32, num_elems, 1024)));
break;
case 1:
structures.push_back(std::make_pair("Sell-16-ne",
createSCS(num_elems, num_ptcls, ppe, element_gids,
16, num_elems, 1024)));
break;
case 2:
structures.push_back(std::make_pair("Sell-32-1024",
createSCS(num_elems, num_ptcls, ppe, element_gids,
32, 1024, 1024)));
break;
case 3:
structures.push_back(std::make_pair("Sell-16-1024",
createSCS(num_elems, num_ptcls, ppe, element_gids,
16, 1024, 1024)));
break;
case 4:
structures.push_back(std::make_pair("Sell-32-1",
createSCS(num_elems, num_ptcls, ppe, element_gids,
32, 1, 1024)));
break;
case 5:
structures.push_back(std::make_pair("Sell-16-1",
createSCS(num_elems, num_ptcls, ppe, element_gids,
16, 1, 1024)));
break;
case 6:
structures.push_back(std::make_pair("CSR",
createCSR(num_elems, num_ptcls, ppe, element_gids)));
break;
}
}
else{
structures.push_back(std::make_pair("Sell-32-ne",
createSCS(num_elems, num_ptcls, ppe, element_gids,
32, num_elems, 1024)));
structures.push_back(std::make_pair("Sell-16-ne",
createSCS(num_elems, num_ptcls, ppe, element_gids,
16, num_elems, 1024)));
structures.push_back(std::make_pair("Sell-32-1024",
createSCS(num_elems, num_ptcls, ppe, element_gids,
32, 1024, 1024)));
structures.push_back(std::make_pair("Sell-16-1024",
createSCS(num_elems, num_ptcls, ppe, element_gids,
16, 1024, 1024)));
structures.push_back(std::make_pair("Sell-32-1",
createSCS(num_elems, num_ptcls, ppe, element_gids,
32, 1, 1024)));
structures.push_back(std::make_pair("Sell-16-1",
createSCS(num_elems, num_ptcls, ppe, element_gids,
16, 1, 1024)));
structures.push_back(std::make_pair("CSR",
createCSR(num_elems, num_ptcls, ppe, element_gids)));
}
const int ITERS = 100;
printf("Performing %d iterations of pseudo-push on each structure\n", ITERS);
/* Perform pseudo-push on particle structures */
for (int i = 0; i < structures.size(); ++i) {
std::string name = structures[i].first;
PS* ptcls = structures[i].second;
printf("Beginning pseudo-push on structure %s\n", name.c_str());
/* Begin Push Setup */
//Per element data to access in pseudoPush
Kokkos::View<double*> parentElmData("parentElmData", ptcls->nElems());
Kokkos::parallel_for("parent_elem_data", parentElmData.size(),
KOKKOS_LAMBDA(const int& e){
parentElmData(e) = sqrt(e) * e;
});
auto nums = ptcls->get<0>();
auto dbls = ptcls->get<1>();
auto dbl = ptcls->get<2>();
auto pseudoPush = PS_LAMBDA(const int& e, const int& p, const bool& mask) {
if(mask){
dbls(p,0) = 10.3;
dbls(p,1) = 10.3;
dbls(p,2) = 10.3;
dbls(p,0) = dbls(p,0) * dbls(p,0) * dbls(p,0) / sqrt(p) / sqrt(e) + parentElmData(e);
dbls(p,1) = dbls(p,1) * dbls(p,1) * dbls(p,1) / sqrt(p) / sqrt(e) + parentElmData(e);
dbls(p,2) = dbls(p,2) * dbls(p,2) * dbls(p,2) / sqrt(p) / sqrt(e) + parentElmData(e);
nums(p) = p;
dbl(p) = parentElmData(e);
}
else{
dbls(p,0) = 0;
dbls(p,1) = 0;
dbls(p,2) = 0;
nums(p) = -1;
dbl(p) = 0;
}
};
for (int i = 0; i < ITERS; ++i) {
Kokkos::fence();
Kokkos::Timer pseudo_push_timer;
/* Begin push operations */
ps::parallel_for(ptcls,pseudoPush,"pseudo push");
/* End push */
Kokkos::fence();
float pseudo_push_time = pseudo_push_timer.seconds();
pumipic::RecordTime(name+" psuedo-push", pseudo_push_time);
}
}
for (size_t i = 0; i < structures.size(); ++i)
delete structures[i].second;
structures.clear();
}
pumipic::SummarizeTime();
Kokkos::finalize();
return 0;
}
PS* createSCS(int num_elems, int num_ptcls, kkLidView ppe, kkGidView elm_gids, int C, int sigma, int V) {
Kokkos::TeamPolicy<ExeSpace> policy(4, C);
pumipic::SCS_Input<PerfTypes> input(policy, sigma, V, num_elems, num_ptcls, ppe, elm_gids);
return new pumipic::SellCSigma<PerfTypes, MemSpace>(input);
}
PS* createCSR(int num_elems, int num_ptcls, kkLidView ppe, kkGidView elm_gids) {
Kokkos::TeamPolicy<ExeSpace> po(32,Kokkos::AUTO);
return new pumipic::CSR<PerfTypes, MemSpace>(po, num_elems, num_ptcls, ppe, elm_gids);
}
|
#include "resources.h"
namespace tna
{
mesh_registry_t* p_mesh_registry = nullptr;;
shader_registry_t* p_shader_registry = nullptr;;
void
resources_init()
{
p_mesh_registry = new mesh_registry_t();
p_shader_registry = new shader_registry_t();
}
void
resources_release()
{
delete p_shader_registry;
delete p_mesh_registry;
}
} /* resources */
|
/***********************************************************************
created: Sat Jun 11 2011
author: Paul D Turner <paul@cegui.org.uk>
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
*
* 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 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.
***************************************************************************/
#ifndef _CEGUIImageFactory_h_
#define _CEGUIImageFactory_h_
#include "CEGUI/Image.h"
// Start of CEGUI namespace section
namespace CEGUI
{
/*!
\brief
Interface for factory objects that create instances of classes
derived from the Image class.
\note
This interface is intended for internal use only.
*/
class ImageFactory
{
public:
//! base class virtual destructor.
virtual ~ImageFactory() {}
//! Create an instance of the Image subclass that this factory creates.
virtual Image& create(const String& name) = 0;
/** Create an instance of the Image subclass that this factory creates
* using the given XMLAttributes object.
*/
virtual Image& create(const XMLAttributes& attributes) = 0;
//! Destroy an instance of the Image subclass that this factory creates.
virtual void destroy(Image& image) = 0;
};
//! Templatised ImageFactory subclass used internally by the system.
template <typename T>
class TplImageFactory : public ImageFactory
{
public:
// Implement ImageFactory interface
Image& create(const String& name) override;
Image& create(const XMLAttributes& attributes) override;
void destroy(Image& image) override;
};
//---------------------------------------------------------------------------//
template <typename T>
Image& TplImageFactory<T>::create(const String& name)
{
return *new T(name);
}
//---------------------------------------------------------------------------//
template <typename T>
Image& TplImageFactory<T>::create(const XMLAttributes& attributes)
{
return *new T(attributes);
}
//---------------------------------------------------------------------------//
template <typename T>
void TplImageFactory<T>::destroy(Image& image)
{
delete ℑ
}
//---------------------------------------------------------------------------//
} // End of CEGUI namespace section
#endif // end of guard _CEGUIImageFactory_h_
|
/*Author: Mehmed Esad AKÇAM
150190725
*/
#include "Faction.h"
class Merchant{
Faction *firstFaction;
Faction *secondFaction;
Faction *thirdFaction;
int startingWeaponPoint;
int startingArmorPoint;
int revenue;
int weaponPointLeft;
int armorPointLeft;
public:
//constructors
Merchant();
Merchant(int,int);
//expected functions
void AssignFactions(Faction *,Faction *,Faction *);
bool SellWeapons(const string&, int);
bool SellArmors(const string&, int);
void EndTurn();
int GetRevenue() const;
int GetWeaponPoints() const;
int GetArmorPoints() const;
};
|
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#include <sstream>
using namespace std;
/*
链接:https://www.nowcoder.com/questionTerminal/72a5a919508a4251859fb2cfb987a0e6
来源:牛客网
答案是斐波那契数列,分析如下:
2*n的大矩形,和n个2*1的小矩形
其中target*2为大矩阵的大小
有以下几种情形:
1) target <= 0 大矩形为<= 2*0,直接return 1;
2) target = 1大矩形为2*1,只有一种摆放方法,return1;
3) target = 2 大矩形为2*2,有两种摆放方法,return2;
4) target = n 分为两步考虑:
第一次摆放一块 2*1 的小矩阵,则摆放方法总共为f(target - 1)
--------------------------
|√|
|√|
--------------------------
第一次摆放一块1*2的小矩阵,则摆放方法总共为f(target-2)
因为,摆放了一块1*2的小矩阵(用√√表示),对应下方的1*2(用××表示)摆放方法就确定了,所以为f(targte-2)
--------------------------
|√√|
|××|
--------------------------
*/
int rectCover(int number) {
// 就是斐波那契数列
if(number < 1) return 0;
if(number <= 2) return number;
int last = 1, cur = 2, tmp;
for(int i = 3; i <= number; ++i){
tmp = cur;
cur += last;
last = tmp;
} return cur;
}
|
#define aref_voltage 3.3
#include <LiquidCrystal.h>
int tempSensorAPin = 0;
int blinkDPin = 13;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
lcd.begin(16, 2);
Serial.begin(9600);
pinMode(blinkDPin, OUTPUT);
analogReference(EXTERNAL);
}
void loop()
{
int reading = analogRead(tempSensorAPin);
float voltage = reading * aref_voltage;
voltage /= 1024.0;
float temperatureC = (voltage - 0.5) * 100;
lcd.clear();
lcd.print(temperatureC); lcd.print(" C");
Serial.print(temperatureC); Serial.println(" C");
digitalWrite(blinkDPin, HIGH);
delay(500);
digitalWrite(blinkDPin, LOW);
delay(500);
}
|
#include <Servo.h>
//Digital Pins
const int motorIn1 = 4;
const int motorIn2 = 5;
const int motorIn3 = 6;
const int motorIn4 = 7;
const int enA = 9;
const int enB = 10;
Servo myservo;
String inByte;
int pos;
int degree;
int speed = 148; //max speed = 255
#define pos_ini 0
void setup()
{
Serial.begin(9600); // Make sure the baud rate is 9600
pinMode(motorIn1, OUTPUT);
pinMode(motorIn2, OUTPUT);
pinMode(motorIn3, OUTPUT);
pinMode(motorIn4, OUTPUT);
pinMode(enA, OUTPUT);
pinMode(enB, OUTPUT);
myservo.attach(3); // servo pin attach to Pin 3
myservo.write(pos_ini); //setup initial position
}
void loop()
{
if(Serial.available()) // If there are any data receieved
{
char cmd = Serial.read();
switch (cmd)
{
case 'f': // recieve 'r', go forward
forward();
break;
case 'b': // recieve 'r', go backward
backward();
break;
case 'l': // recieve 'l', turn left
left();
break;
case 'r': // recieve 'r', turn right
right();
break;
case 's':
motorstop(); // stop the motors
break;
case 't':
servoturn(30);
break;
case 'u':
servoturn(60);
break;
default:
break;
}
Serial.flush();
}
delay(10);
}
void servoturn(int degree)
{
//inByte = Serial.readStringUntil('\n'); // read data until newline
//degree = inByte.toInt();
for(pos = 0; pos <= 180; pos += degree) // goes from 0 degrees to 180 degrees
{
int j = pos;
for(int i = j; i <= pos + degree; i += 1){
myservo.write(i);
delay(20);
}
delay(1800);
}
for(int i =180; i>=0; i -= 1){
myservo.write(i);
delay(15);
}
}
void motorstop()
{
digitalWrite(motorIn1, LOW);
digitalWrite(motorIn2, LOW);
digitalWrite(motorIn3, LOW);
digitalWrite(motorIn4, LOW);
}
void forward()
{
//digitalWrite(motorIn1, HIGH);
//digitalWrite(motorIn2, LOW);
//digitalWrite(motorIn3, HIGH);
//digitalWrite(motorIn4, LOW);
analogWrite(motorIn1, speed);
analogWrite(motorIn2, 0);
analogWrite(motorIn3, speed);
analogWrite(motorIn4, 0);
analogWrite(enB, 200);
analogWrite(enA, 200);
}
void backward()
{
//digitalWrite(motorIn1, LOW);
//digitalWrite(motorIn2, HIGH);
//digitalWrite(motorIn3, LOW);
//digitalWrite(motorIn4, HIGH);
analogWrite(motorIn1, 0);
analogWrite(motorIn2, speed);
analogWrite(motorIn3, 0);
analogWrite(motorIn4, speed);
analogWrite(enB, 200);
analogWrite(enA, 200);
}
void right()
{
//digitalWrite(motorIn1, LOW);
//digitalWrite(motorIn2, HIGH);
//digitalWrite(motorIn3, HIGH);
//digitalWrite(motorIn4, LOW);
analogWrite(motorIn1, 0);
analogWrite(motorIn2, speed);
analogWrite(motorIn3, speed);
analogWrite(motorIn4, 0);
analogWrite(enB, 200);
analogWrite(enA, 200);
}
void left()
{
//digitalWrite(motorIn1, HIGH);
//digitalWrite(motorIn2, LOW);
//digitalWrite(motorIn3, LOW);
//digitalWrite(motorIn4, HIGH);
analogWrite(motorIn1, speed);
analogWrite(motorIn2, 0);
analogWrite(motorIn3, 0);
analogWrite(motorIn4, speed);
analogWrite(enB, 200);
analogWrite(enA, 200);
}
|
#include "dsl/interpreter.h"
#include <vector>
#include <experimental/optional>
namespace dm {
class device_manager {
public:
device_manager(std::string programFile);
~device_manager();
dsl::Input getInput(std::string line);
void addDev(dsl::Input input);
void addCon(std::string context, int clusterID);
void rmDev(dsl::Input input);
void rmCon(std::string context);
void print_context_clusterings();
void print_device_clusterings();
private:
dsl::Program prog;
using dev_cluster = std::vector<dsl::Input>;
std::unordered_map<int, dev_cluster*> DC_clusters;
std::unordered_map<std::string, std::vector< std::pair<int, dev_cluster*> >* > context_clusters;
std::unordered_map<int, std::vector<std::string>> DC_cluster_dependants;
std::experimental::optional<int> get_cluster_ID(dsl::Input &input);
};
}
|
#include "experimenthandler.h"
#include <QDebug>
#include <QtGui>
#include <QtCore>
#include <qtimer.h>
#include <QDesktopWidget>
#include <QMessageBox>
#define SEC 1000
ExperimentHandler::ExperimentHandler(FullScreenWidget *screen,QObject *parent) :
QObject(parent)
{
m_screen = screen;
m_experiment = Experiment::getInstance();
setUpScreenDetails();
setUpExperiment();
setUpTimers();
setUpEvents();
m_runningTrial=0;
runNextTrial();
}
void ExperimentHandler::onShowAnswerTimeout()
{
m_screen->setLinesBlack();
m_showBlackScreenTimer->start((int)(m_experiment->getShowBlackScreen()*SEC));
}
void ExperimentHandler::runNextTrial()
{
qDebug() << "runNextTrial";
if(m_experiment->getNumberOfTrials() <= m_runningTrial)
{
finishExperiment();
}
else
{
m_screen->setLinesWhite();
Trial trial = m_experiment->getTrials().at(m_runningTrial);
qreal centerX = m_screenWidth/2.0;
qreal centerY = m_screenHeight/2.0;
qreal distance = toPixels(trial.getDistance());
qreal leftLine = toPixels(trial.getLengthLeftLine());
qreal rightLine = toPixels(trial.getLengthRightLine());
qreal leftX = centerX - distance/2;
qreal rightX = centerX + distance/2;
m_screen->setLeftLine(leftX, centerY - leftLine/2 ,leftX , centerY + leftLine/2);
m_screen->setRightLine(rightX, centerY - rightLine/2, rightX, centerY + rightLine/2);
m_trialTimer->start((int)(m_experiment->getMaxAnswerTime()*SEC));
}
}
void ExperimentHandler::setUpTimers()
{
m_trialTimer = new QTimer(this);
m_showAnswerTimer = new QTimer(this);
m_showBlackScreenTimer = new QTimer(this);
m_trialTimer->setSingleShot(true);
m_showAnswerTimer->setSingleShot(true);
m_showBlackScreenTimer->setSingleShot(true);
connect(m_trialTimer, SIGNAL(timeout()),this, SLOT(onTrialTimeout()));
connect(m_showAnswerTimer, SIGNAL(timeout()),this, SLOT(onShowAnswerTimeout()));
connect(m_showBlackScreenTimer, SIGNAL(timeout()),this, SLOT(onShowBlackScreenTimeout()));
}
void ExperimentHandler::setUpScreenDetails()
{
qreal screenWidth = m_experiment->getScreenWidth();
QDesktopWidget widget;
QRect rec = widget.availableGeometry(widget.primaryScreen());
m_screenHeight = rec.height();
m_screenWidth = rec.width();
qDebug() << m_screenWidth << " x " << m_screenHeight ;
m_pixelsPerMeter = m_screenWidth/screenWidth;
}
qreal ExperimentHandler::toPixels(qreal meters)
{
return meters*m_pixelsPerMeter;
}
void ExperimentHandler::setUpExperiment()
{
m_screen->setLinesThickness(toPixels(m_experiment->getLineThickness()));
qreal maxLength = m_experiment->getMaxLength();
qreal minLength = m_experiment->getMinLength();
qreal lengthStep = m_experiment->getLengthStep();
uint lengthNumbers = (int)((maxLength - minLength)/lengthStep) + 1;
if(m_experiment->getTrials().size())
m_experiment->getTrials().clear();
for(uint i=0; i<m_experiment->getNumberOfTrials(); i++)
{
Trial trial;
// generate random values for m_lengthLeftLine, m_lengthRightLine
int randomValue = qrand() % lengthNumbers;
qreal leftLine = randomValue*lengthStep + minLength;
trial.setLengthLeftLine(leftLine);
randomValue = qrand() % lengthNumbers;
qreal rightLine = randomValue*lengthStep + minLength;
trial.setLengthRightLine(rightLine);
randomValue = qrand() % m_experiment->getDiferrentDistances() + 1;
switch(randomValue)
{
case 1: trial.setDistance(m_experiment->getDistance1()); break;
case 2: trial.setDistance(m_experiment->getDistance2()); break;
case 3: trial.setDistance(m_experiment->getDistance3()); break;
case 4: trial.setDistance(m_experiment->getDistance4()); break;
case 5: trial.setDistance(m_experiment->getDistance5()); break;
default:break;
}
m_experiment->getTrials().push_back(trial);
}
}
void ExperimentHandler::setUpEvents()
{
connect(m_screen, SIGNAL(leftBtnPushed()),this, SLOT(onLeftBtnPushed()));
connect(m_screen, SIGNAL(rightBtnPushed()),this, SLOT(onRightBtnPushed()));
connect(m_screen, SIGNAL(upBtnPushed()),this, SLOT(onUpBtnPushed()));
}
void ExperimentHandler::onLeftBtnPushed()
{
qDebug()<< "onLeftBtnPushed";
saveLatency();
m_screen->setLeftLineBlue();
m_trialTimer->stop();
trialResults(e_left);
m_showAnswerTimer->start((int)(m_experiment->getShowAnswer()*SEC));
}
void ExperimentHandler::onRightBtnPushed()
{
qDebug()<< "onRightBtnPushed";
saveLatency();
m_screen->setRightLineBlue();
m_trialTimer->stop();
trialResults(e_right);
m_showAnswerTimer->start((int)(m_experiment->getShowAnswer()*SEC));
}
void ExperimentHandler::onUpBtnPushed()
{
qDebug()<< "onUpBtnPushed";
saveLatency();
m_screen->setLinesBlue();
m_trialTimer->stop();
trialResults(e_equal);
m_showAnswerTimer->start((int)(m_experiment->getShowAnswer()*SEC));
}
void ExperimentHandler::onTrialTimeout()
{
qDebug() << "onTrialTimeout";
//Answer: None
saveLatency();
trialResults(e_none);
m_screen->setLinesRed();
m_showAnswerTimer->start((int)(m_experiment->getShowAnswer()*SEC));
}
void ExperimentHandler::onShowBlackScreenTimeout()
{
m_runningTrial++;
runNextTrial();
}
void ExperimentHandler::trialResults(LongerLineAnswer_T answer)
{
//m_experiment->getTrials()[m_runningTrial].setAnswer(e_none);
Trial &trial = m_experiment->getTrials()[m_runningTrial];;
trial.setAnswer(answer);
if(answer==e_none)
{
trial.setValid(false);
}
else
{
trial.setValid(true);
}
switch (answer)
{
case e_left:
{
if(trial.getLengthLeftLine() > trial.getLengthRightLine())
{
trial.setCorrect(true);
}
break;
}
case e_right:
{
if(trial.getLengthLeftLine() < trial.getLengthRightLine())
{
trial.setCorrect(true);
}
break;
}
case e_equal:
if(trial.getLengthLeftLine() == trial.getLengthRightLine())
{
trial.setCorrect(true);
}
break;
default: break;
}
}
void ExperimentHandler::finishExperiment()
{
// write results
writeCSVfile();
if (QMessageBox::Ok == QMessageBox(QMessageBox::Information, "Lines", "Thank you!", QMessageBox::Ok).exec())
{
m_screen->close();
}
}
void ExperimentHandler::writeCSVfile()
{
QString path(m_experiment->getDataPath());
QString fileName;
fileName = "/" + m_experiment->getTaskName() + " "
+ m_experiment->getSubject() + " "
+ "Block " + QString::number(m_experiment->getBlock()) + " "
+ QDateTime::currentDateTime().toString("dd-MM-yyyy hh-mm-ss")
+ ".csv";
QFile file(path + fileName);
// qDebug() << path + fileName ;
if (file.open(QFile::WriteOnly|QFile::Truncate))
{
QTextStream stream(&file);
stream << "Name;Block;TrialNum;Valid;Latency;Distance;LeftLineLength;RightLineLength;Answer;Correct\n";
for(int i=0; i<m_experiment->getTrials().size(); i++)
{
Trial &trial = m_experiment->getTrials()[i];
stream << m_experiment->getSubject() << ";"
<< m_experiment->getBlock() << ";"
<< (i+1) << ";"
<< trial.isValid() << ";"
<< trial.getLatency() << ";"
<< trial.getDistance() << ";"
<< trial.getLengthLeftLine() << ";"
<< trial.getLengthRightLine() << ";"
<< trial.getAnswer() << ";"
<< trial.isCorrect() << ";"
<<"\n";
}
file.close();
}
}
void ExperimentHandler::saveLatency()
{
Trial &trial = m_experiment->getTrials()[m_runningTrial];
int msecLatency = m_trialTimer->interval() - m_trialTimer->remainingTime();
qreal latency = (qreal)(msecLatency)/SEC;
trial.setLatency(latency);
}
|
#include<bits/stdc++.h>
using namespace std;
char dic[30][20] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty", "a", "both", "another", "first", "second", "third"};
int di[30] = {0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 00, 21, 44, 69, 96, 25, 56, 89, 24, 61, 0, 1, 4, 1, 1, 4, 9};
unsigned long long int a[10], top, flag;
int i, j;
char s[100];
int main()
{
for(i = 1; i <= 6; i++)
{
scanf("%s", &s);
for(j = 1; j <= 26; j++)
{
if(!strcmp(s, dic[j]))
{
a[++top] = di[j];
break;
}
}
}
sort(a + 1, a + top + 1);
for(i = 1; i <= top; i++)
{
if(flag)
printf("%.2d",a[i]);
else
if(a[i])
{
printf("%d", a[i]);
flag = 1;
}
}
if(!flag) printf("0");
return 0;
}
|
#include <my_global.h>
#include <mysql.h>
void finish_with_error(MYSQL *con)
{
fprintf(stderr, "%s\n", mysql_error(con));
mysql_close(con);
exit(1);
}
int Push_Data(int id, float data)
{
char query[64];
MYSQL *con = mysql_init(NULL);
if(con == NULL)
{
fprintf(stderr, "%s\n", mysql_error(con));
return -1;
}
if (mysql_real_connect(con,"localhost","root","","Project",0,NULL,0)==NULL)
{
finish_with_error(con);
}
sprintf(query, "UPDATE House_DB SET Temperature=%f WHERE ID=%d" ,data, id);
if (mysql_query(con, query))
{
finish_with_error(con);
}
mysql_close(con);
return 0;
}
int main()
{
int id = 2;
int status;
float data = 73.37;
status = Push_Data(id, data);
if(status == 0)
{
exit(0);
}
else
{
exit(1);
}
}
|
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the University of Oxford nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "Swan2012AcinarUnit.hpp"
#include "MathsCustomFunctions.hpp"
#include <cmath>
#include <iostream>
Swan2012AcinarUnit::Swan2012AcinarUnit() : mQ(0.0),
mLambda(1.26),
mDt(-1),
mPaw(0.0),
mPpl(0.0),
mRaw(0.0),
mA(0.433),
mB(-0.611),
mXi(2500),
mV0(1.0)
{
}
Swan2012AcinarUnit::~Swan2012AcinarUnit()
{
}
void Swan2012AcinarUnit::SetTimestep(double dt)
{
}
void Swan2012AcinarUnit::SolveAndUpdateState(double tStart, double tEnd)
{
}
void Swan2012AcinarUnit::ComputeExceptFlow(double tStart, double tEnd)
{
double Pe = CalculateStaticRecoilPressure(mLambda);
mPaw = Pe + mPpl;
}
void Swan2012AcinarUnit::UpdateFlow(double tStart, double tEnd)
{
double dt = tEnd - tStart;
double compliance_factor = CalculateDerivativeStaticRecoilPressureByStrain();
mQ = (1 - std::exp(-dt*compliance_factor/mRaw))*mQ*mRaw/compliance_factor/dt;
double V = GetVolume();
V += dt*mQ;
mLambda = std::pow(V/mV0, 1.0/3.0);
}
void Swan2012AcinarUnit::SetFlow(double flow)
{
mQ = flow;
}
double Swan2012AcinarUnit::GetFlow()
{
return mQ;
}
void Swan2012AcinarUnit::SetAirwayPressure(double pressure)
{
mPaw = pressure;
}
double Swan2012AcinarUnit::GetAirwayPressure()
{
return mPaw;
}
void Swan2012AcinarUnit::SetPleuralPressure(double pressure)
{
mPpl = pressure;
}
void Swan2012AcinarUnit::SetTerminalBronchioleResistance(double raw)
{
mRaw = raw;
}
double Swan2012AcinarUnit::GetStretchRatio()
{
return mLambda;
}
void Swan2012AcinarUnit::SetStretchRatio(double lambda)
{
mLambda = lambda;
}
double Swan2012AcinarUnit::GetVolume()
{
return mLambda*mLambda*mLambda*mV0;
}
void Swan2012AcinarUnit::SetUndeformedVolume(double v0)
{
mV0 = v0;
}
double Swan2012AcinarUnit::CalculateDerivativeVolumeByStrain()
{
return 3*mLambda*mLambda*mV0;
}
double Swan2012AcinarUnit::CalculateDerivativeStaticRecoilPressureByStrain()
{
double gamma = CalculateGamma(mLambda);
return ((3.0*mXi/2.0)*(3*mA + mB)*(3*mA + mB)*(mLambda*mLambda - 1)*(mLambda*mLambda - 1)*std::exp(gamma) +
(mXi/2.0)*(3*mA + mB)*(mLambda*mLambda + 1)*std::exp(gamma)/(mLambda*mLambda))/CalculateDerivativeVolumeByStrain();
}
double Swan2012AcinarUnit::CalculateGamma(double lambda)
{
return (3.0/4.0)*(3*mA + mB)*(lambda*lambda - 1)*(lambda*lambda - 1);
}
double Swan2012AcinarUnit::CalculateStaticRecoilPressure(double lambda)
{
double gamma = CalculateGamma(lambda);
return mXi*std::exp(gamma)/(2.0*lambda)*(3*mA + mB)*(lambda*lambda -1);
}
|
#include "Bone.h"
using namespace kyrbos;
Bone::Bone()
{
D3DXMatrixIdentity(&m_Matrix);
}
|
#include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
int main(int argc, char** argv) {
// 初始化变量和随机值
Mat image(600, 600, CV_8UC3);
RNG& rng = theRNG();
// 循环, 按下ESC, Q, q键程序退出, 否则有键按下便一直更新
while (1) {
// 参数初始化
char key; // 键值
int count = (unsigned)rng % 100 + 3; // 随机生成点的数量
vector<Point> points; // 点值
// 随机生成点坐标
for (int i=0; i < count; i++) {
Point point;
point.x = rng.uniform(image.cols/4, image.cols*3/4);
point.y = rng.uniform(image.rows/4, image.rows*3/4);
points.push_back(point);
}
// 检测凸包
vector<int> hull;
convexHull(Mat(points), hull, true);
// 绘制出随机颜色的点
image = Scalar::all(0);
for (int i=0; i < count; i++) {
circle(image, points[i], 3,
Scalar(rng.uniform(0, 255), rng.uniform(0, 255), rng.uniform(0, 255)),
FILLED, LINE_AA);
}
// 准备参数
int hullcount = (int)hull.size(); // 凸包的边数
Point point0 = points[hull[hullcount-1]]; // 连接凸包边的坐标点
// 绘制凸包的边
for (int i=0; i < hullcount; i++) {
Point point = points[hull[i]];
line(image, point0, point, Scalar(255, 255, 255), 2, LINE_AA);
point0 = point;
}
// 显示效果图
imshow("凸包检测示例", image);
// 按下ESC, Q或者q, 程序退出
key = (char)waitKey();
if (key == 27 || key == 'q' || key == 'Q')
break;
}
return 0;
}
|
#include "../../include/infra/Common.hpp"
#include <chrono>
#include <boost/multiprecision/cpp_dec_float.hpp>
/******************************/
/* Helper Methods *************/
/******************************/
int find_log2_floor(biginteger bi) {
if (bi < 0)
throw runtime_error("log for negative number is not supported");
int r = 0;
while (bi >>= 1) // unroll for more speed...
r++;
return r;
}
int NumberOfBits(const biginteger bi) {
auto bis = (bi>0) ? bi : -bi;
return find_log2_floor(bis)+ 1;
}
void gen_random_bytes_vector(vector<byte> &v, const int len, mt19937 random) {
static const char alphanum[] =
"0123456789"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz";
for (int i = 0; i < len; ++i)
v.push_back(alphanum[random() % (sizeof(alphanum) - 1)]);
}
/**
* Copies all byte from source vector to dest starting from some index in dest.
* Assuming dest is already initialized.
*/
void copy_byte_vector_to_byte_array(const vector<byte> &source_vector, byte * dest, int beginIndex) {
for (auto it = source_vector.begin(); it != source_vector.end(); ++it) {
int index = std::distance(source_vector.begin(), it) + beginIndex;
dest[index] = *it;
}
}
void copy_byte_array_to_byte_vector(const byte* src, int src_len, vector<byte>& target_vector, int beginIndex)
{
target_vector.insert(target_vector.end(), &src[beginIndex], &src[src_len]);
}
/*
* Length of biginteger in bytes
*/
size_t bytesCount(biginteger value)
{
if (value.is_zero())
return 1;
if (value.sign() < 0)
value = ~value;
size_t length = 0;
byte lastByte;
do {
lastByte = value.convert_to<byte>();
value >>= 8;
length++;
} while (!value.is_zero());
if (lastByte >= 0x80)
length++;
return length;
}
void encodeBigInteger(biginteger value, byte* output, size_t length)
{
if (value.is_zero())
*output = 0;
else if (value.sign() > 0)
while (length-- > 0) {
*(output++) = value.convert_to<byte>();
value >>= 8;
}
else {
value = ~value;
while (length-- > 0) {
*(output++) = ~value.convert_to<byte>();
value >>= 8;
}
}
}
biginteger decodeBigInteger(byte* input, size_t length)
{
biginteger result(0);
int bits = -8;
while (length-- > 1)
result |= (biginteger) *(input++) << (bits += 8);
byte a = *(input++);
result |= (biginteger) a << (bits += 8);
if (a >= 0x80)
result |= (biginteger) - 1 << (bits + 8);
return result;
}
biginteger convert_hex_to_biginteger(const string & input) {
string s = "0x" + input;
return boost::lexical_cast<biginteger>(s);
}
string hexStr(vector<byte> const & data)
{
string res;
boost::algorithm::hex(data.begin(), data.end(), back_inserter(res));
boost::algorithm::to_lower(res);
return res;
}
mt19937 get_seeded_random() {
mt19937 mt;
auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();
mt.seed(seed);
return mt;
}
mt19937_64 get_seeded_random64() {
mt19937_64 mt;
auto seed = chrono::high_resolution_clock::now().time_since_epoch().count();
mt.seed(seed);
return mt;
}
void print_elapsed_ms(std::chrono::time_point<std::chrono::system_clock> start, string message) {
auto end = std::chrono::system_clock::now();
int elapsed_ms = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
cout << message << " took: " << elapsed_ms << " ms" << endl;
}
std::chrono::time_point<std::chrono::system_clock> scapi_now() {
return chrono::system_clock::now();
}
biginteger getRandomInRange(biginteger min, biginteger max, std::mt19937 random)
{
boost::random::uniform_int_distribution<biginteger> ui(min, max);
biginteger res = ui(random);
return res;
}
void print_byte_array(byte * arr, int len, string message)
{
cout << message << endl;
for (int i = 0; i < len; i++)
cout << (int)arr[i] << ",";
cout << endl;
}
|
// Menghitung banyaknya bangunan yang ada di map
// Made by Bayu Dasprog C 0172 copyright 2019 :))
#include <stdio.h>
char maps[100][100];
int n,count=0,x,y;
int a,b;
int build ()//Build map function
{
int i=0,j=0;
while(1)
{
char c = getchar();
if (c == EOF)
{
a++;
return 0;
}
if (c == '\n')
{
i++;
a=i;
b=j;
j=0;
}
if (c == '0' || c== '1')
{
maps[i][j]=c;
j++;
}
}
}
int buildingcheck(int x, int y)
{
// Base case
if (x<0||x>b-1||y<0||y>a-1) //
return 0;
// Rercursive case
if (maps[y][x]!='0')
{
maps[y][x] = '0';// menandai yg sudah dilewati
if (buildingcheck(x+1,y)) //turn right
{
return 1;
}
if (buildingcheck(x-1,y))//turn left
{
return 1;
}
if (buildingcheck(x,y-1))//turn down
{
return 1;
}
if (buildingcheck(x,y+1))//turn down
{
return 1;
}
return 0;
}
else return 0;
}
int main ()
{
int x,y;
build();
// printf("%d %d",a,b);
// for (int i=0;i<a;i++) // scan le rat and le cheese
// {
// for (int j=0;j<b;j++)
// {
// printf("%c",maps[i][j]);
// }
// printf("\n");
// }
for (int i=0;i<a;i++) // scan le rat and le cheese
{
for (int j=0;j<b;j++)
{
if (maps[i][j]=='1') // Cek mulai Bangunan
{
y=i;
x=j;
buildingcheck(x,y);
count++;
}
}
}
printf("%d\n",count);
// printf("%d %d",a,b);
}
|
#ifndef PWMWEBSERVER_H
#define PWMWEBSERVER_H
#include "httpendpoint.h"
#include "httpendpointjsonget.h"
#include "httpendpointjsonset.h"
#include "pwminterface.h"
#include <SmingCore.h>
#include <array>
#include <vector>
class PwmWebServer {
public:
PwmWebServer(PwmInterface &pwm);
void init();
void onAjaxAsArray(HttpRequest &request, HttpResponse &response);
private:
HttpServer server;
PwmInterface &pwm;
HttpEndpoint testEndpoint;
HttpEndpointJsonGet<unsigned int> endpointChannelCount;
HttpEndpointJsonGet<std::array<int, 3>> endpointTest;
HttpEndpointJsonSet<bool> endpointSetBool;
HttpEndpointJsonSet<int> endpointSetInt;
HttpEndpointJsonSet<String> endpointSetString;
std::array<int, 3> get_a_vector();
};
#endif // PWMWEBSERVER_H
|
/*****
描述
生日蛋糕上有三棵草莓,小F想把蛋糕切成形状完全相同的三块,并且每一块上都有一个草莓。你可以把草莓看成一个点,切块的时候不能切中草莓。请问能否切成满足相同的三块?
关于输入
第一行包含一个整数t表示有t组测试数据。
每组测试数据一行,包含7个整数:r x1 y1 x2 y2 x3 y3,r表示蛋糕半径,(x1,y1)(x2,y2)(x3,y3)表示三个草莓的位置(以圆心为坐标轴原点)。
关于输出
对每组数据输出一行。
如果能够切成全等的三块并且每块上有一个草莓,输出"Yes",否则输出"No"
例子输入
2
2 1 1 -1 1 0 -1
10 0 9 1 8 -1 8
例子输出
Yes
No
*****/
#include<iostream>;
#include<cmath>;
using namespace std;
#define MAX_N 10
bool check_angle(double x1, double y1, double x2, double y2)
{
return (x1*x2 + y1*y2) / (sqrt(x1*x1 + y1*y1) * sqrt(x2*x2 + y2*y2)) > -0.5;
}
bool check_outside(double r, double x, double y)
{
return sqrt(x*x + y*y) > r;
}
bool check_center(double x, double y)
{
return x*x + y*y == 0;
}
int main()
{
int t;
cin >> t;
for(int case_ = 0; case_ < t; case_++)
{
double r, x[MAX_N], y[MAX_N];
int n = 3;
bool flag = false, flag2 = true;
cin >> r;
for (int i = 0; i < n; i++)
cin >> x[i] >> y[i];
for (int i = 0; i < n; i++)
{
int j = (i + 1) % n;
if (flag2 && !check_angle(x[i], y[i], x[j], y[j]))
flag2 = false;
if (check_outside(r, x[i], y[i]) || check_center(x[i], y[i]))
{
flag = true;
break;
}
}
flag |= flag2;
if (flag)
cout << "No" << endl;
else
cout << "Yes" << endl;
}
return 0;
}
|
#include <iostream>
#include <time.h>
#include <stdlib.h>
#include <conio.h>
#include <windows.h>
#include <fstream>
#include <sstream>
using namespace std;
void screenheader()
{
system("cls");
system("color f1");
cout << "\n\t \xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2";
cout << "\n\t \xB2\xB2 \xB2\xB2";
cout << "\n\t \xB2\xB2 @@@@@@@@@@@@@@@@@@@@@@@ \xB2\xB2";
cout << "\n\t \xB2\xB2 @ @ \xB2\xB2";
cout << "\n\t \xB2\xB2 @ WELCOME TO @ \xB2\xB2";
cout << "\n\t \xB2\xB2 @ TIC TAC TOE @ \xB2\xB2";
cout << "\n\t \xB2\xB2 @ GAME @ \xB2\xB2";
cout << "\n\t \xB2\xB2 @ @ \xB2\xB2";
cout << "\n\t \xB2\xB2 @ @ \xB2\xB2";
cout << "\n\t \xB2\xB2 @ @ \xB2\xB2";
cout << "\n\t \xB2\xB2 @ @ \xB2\xB2";
cout << "\n\t \xB2\xB2 @@@@@@@@@@@@@@@@@@@@@@@ \xB2\xB2";
cout << "\n\t \xB2\xB2 \xB2\xB2";
cout << "\n\t \xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\xB2\n\n";
cout << "\n\n\t\t\t\t-----------------------------------" << endl;
}
int login()
{
int count=0;
string user, pass, u, p;
system("cls");
cout << "\n\n\n\t\t\t\tplease enter details" << endl;
cout << "\t\t\t\tUSERNAME :";
cin >> user;
cout << "\t\t\t\tPASSWORD :";
cin >> pass;
ifstream input("registeration.txt");
while (input >> u >> p)
{
if (u == user && p == pass)
{
count = 1;
}
}
input.close();
if (count == 1)
{
system("cls");
cout << "\n\n\n\t\t\t\tHello " << user << "\n\t\t\t\tLOGIN SUCESS\n\t\t\t\tWe're glad that you're here.";
cout << "\n\t\t\t\tThanks for logging in\n\n\t\t\t\t";
system("pause");
return 1;
}
else
{
cout << "\n\t\t\t\t NO SUCH USER EXITS LOGIN ERROR\n\t\t\t\t";
system("pause");
return 0;
}
}
void registr()
{
string user;
string pass, ru, rp;
system("cls");
cout << "\n\n\n\t\t\t\tRegistration" << endl << endl;
cout << "\t\t\t\tEnter the username :";
cin >> user;
cout << "\n\t\t\t\tEnter the password :";
cin >> pass;
ofstream reg("registeration.txt", ios::app);
reg << user << ' ' << pass << endl;
cout << "\n\n\n\t\t\t\tRegistration Sucessful!\n\t\t\t\t";
system("pause");
}
struct node
{
char info;
int pos;
int step;
node* next;
};
class linkedlist
{
node* head, * tail;
int step;
public:
linkedlist()
{
head = NULL;
tail = NULL;
step = 0;
}
void addnodes(char i, int pos)
{
node* temp = new node;
temp->info = i;
temp->pos = pos;
temp->step = this->step;
temp->next = NULL;
if (head == NULL)
{
head = temp;
tail = temp;
}
else
{
tail->next = temp;
tail = tail->next;
}
this->step++;
}
void deletelist()
{
head = NULL;
tail = NULL;
step = 0;
}
void display()
{
node* temp = head;
cout << endl;
while (temp != NULL)
{
cout << "\tSTEP:" << temp->step << " POS: " << temp->pos << ", INPUT: " << temp->info << "------>\n";
temp = temp->next;
}
cout << "\tNULL\n";
}
};
class multi
{
char board[16];
int choice;
char p1mark;
char p2mark;
int turn;
string p1name;
string p2name;
linkedlist l1;
public:
multi(string p1name, string p2name)
{
this->p1name = p1name;
this->p2name = p2name;
int temp = 48;
for (int i = 0; i < 10; i++)
{
board[i] = (int)temp;
temp++;
}
board[10] = 'a';
board[11] = 'b';
board[12] = 'c';
board[13] = 'd';
board[14] = 'e';
board[15] = 'f';
p1mark = 'O';
p2mark = 'X';
turn = 0;
}
void makeboard()
{
system("cls");
cout << "\n\n\t\t" << p1name << "(O)\tvs\t" << p2name << "(X)" << endl;
cout << "\t\t\t|\t|\t |\t" << endl;
cout << "\t " << board[0] << "\t| " << board[1] << "|\t" << board[2] << "|\t" << board[3] << endl;
cout << "\t\t________|_______|________|________" << endl;
cout << "\t\t\t|\t|\t |\t" << endl;
cout << "\t " << board[4] << "\t| " << board[5] << "|\t" << board[6] << "|\t" << board[7] << endl;
cout << "\t\t________|_______|________|________" << endl;
cout << "\t\t\t|\t|\t |\t" << endl;
cout << "\t " << board[8] << "\t| " << board[9] << "|\t" << board[10] << "|\t" << board[11] << endl;
cout << "\t\t________|_______|________|________" << endl;
cout << "\t\t\t|\t|\t |\t" << endl;
cout << "\t " << board[12] << "\t| " << board[13] << "|\t" << board[14] << "|\t" << board[15] << endl;
cout << "\t\t | | | " << endl;
}
void addmark(int pos)
{
if (turn % 2 == 0)
{
board[pos] = p1mark;
l1.addnodes(p1mark, pos);
}
else
{
board[pos] = p2mark;
l1.addnodes(p2mark, pos);
}
turn++;
}
int decide()
{
if (board[0] == board[1] && board[1] == board[2] && board[2] == board[3])
return 1;
else if (board[4] == board[5] && board[5] == board[6] && board[6] == board[7])
return 1;
else if (board[8] == board[9] && board[9] == board[10] && board[10] == board[11])
return 1;
else if (board[12] == board[13] && board[13] == board[14] && board[14] == board[15])
return 1;
else if (board[0] == board[4] && board[4] == board[8] && board[8] == board[12])
return 1;
else if (board[1] == board[5] && board[5] == board[9] && board[9] == board[13])
return 1;
else if (board[2] == board[6] && board[6] == board[10] && board[10] == board[14])
return 1;
else if (board[3] == board[7] && board[7] == board[11] && board[11] == board[15])
return 1;
else if (board[0] == board[5] && board[5] == board[10] && board[10] == board[15])
return 1;
else if (board[3] == board[6] && board[6] == board[9] && board[9] == board[12])
return 1;
else if (board[0] != '0' && board[1] != '1' && board[2] != '2' && board[3] != '3'
&& board[4] != '4' && board[5] != '5' && board[6] != '6'
&& board[7] != '7' && board[8] != '8' && board[9] != '9'
&& board[10] != 'a' && board[11] != 'b' && board[12] != 'c' && board[13] != 'd'
&& board[14] != 'e' && board[15] != 'f')
return 0;
else
return -1;
}
void engine()
{
system("cls");
int result;
char ask;
do
{
this->makeboard();
this->makechoice();
result = decide();
} while (result == -1);
this->makeboard();
if (result == 0)
{
cout << "\n\t\tGAME IS A DRAW\n";
}
else
{
if (turn % 2 == 0)
{
cout << "\n\t\t" << p2name << " WINS\n";
}
else
{
cout << "\n\t\t" << p1name << " WINS\n";
}
}
l1.display();
//if game over, display steps, compare the list to the sol. if new, put it there.
//delete list and then ask for a new game with same players
l1.deletelist();
cout << "\n\tDO YOU WANT A NEW GAME WITH THE SAME PLAYERS?(y/n)";
cin >> ask;
if (toupper(ask) == 'Y')
{
multi* p = new multi(this->p1name, this->p2name);
p->engine();
}
else
{
delete this;
}
}
void makechoice()
{
if (turn % 2 == 0)
{
cout << "\n\n\t\t\tITS YOUR TURN, " << p1name;
}
else
{
cout << "\n\n\t\t\tITS YOUR TURN, " << p2name;
}
char choice;
int change;
int problem = 0;
do {
cout << "\nPICK THE PLACE WHERE YOU WANT TO PLACE YOUR MARK BY ENTERING THAT NUMBER: ";
cin >> choice;
cout << choice;
switch (choice)
{
case 'a': change = 10;
break;
case 'b': change = 11;
break;
case 'c': change = 12;
break;
case 'd': change = 13;
break;
case 'e': change = 14;
break;
case 'f': change = 15;
break;
default: change = (int)choice - 48;
}
if ((choice < 48 || choice>57) && (choice < 97 || choice>102) || board[change] == p1mark || board[change] == p2mark)
{
cout << "\nERROR!!! WRONG INPUT\n";
problem = 1;
}
else
{
addmark(change);
problem = 0;
}
} while (problem == 1);
}
};
int menu()
{
int choice;
cout << "\n\n\t\t\tMAIN MENU";
cout << "\n\n\n\t\t\t1. SINGLE PLAYER";
cout << "\n\t\t\t2. MULTIPLAYER";
cout << "\n\t\t\t3. HIGH SCORE";
cout << "\n\t\t\t4. HOW TO PLAY";
cout << "\n\t\t\t5. EXIT";
cout << "\n\t\t\tENTER YOUR CHOICE: ";
cin >> choice;
return choice;
}
void howtoplay()
{
system("cls");
cout << "\n\n\t\tInstructions:";
cout << "\n\n\t\tTHE PLAYER MUST SELECT A SPOT WHERE THEY WANT TO PLACE THEIR MARK.\n";
cout << "\t\tAFTER ALL THE SPOTS HAVE BEEN PICKED AND THERE IS NO WINNER,THE GAME ENDS IN A DRAW.\n";
cout << "\t\tOTHERWISE, THE GAME IS WON BY WHOEVER COMPLETES A ROW,DIAGONAL, OR A COLUMN WITH THEIR MARK\n\n\t\t";
system("pause");
}
struct StepNode {
int row, col;
int step;
StepNode* s_next;
};
struct Node {
int priorty;
int id[2];
Node* next;
StepNode* s_node;
};
class DeepLearner {
Node* head, * rear;
StepNode* s_head, * s_rear, * in_game_traverser;
int n_sols, step_no;
void swap_sol(Node* T1, Node* T2) {
if (T1 == NULL || T2 == NULL || head == NULL || rear == NULL) { return; }
Node* temp = T1;
T1->priorty = T2->priorty;
T1->id[0] = T2->id[0];
T1->id[1] = T2->id[1];
T1->s_node = NULL;
T1->s_node = T2->s_node;
T2->priorty = temp->priorty;
T2->id[0] = temp->id[0];
T2->id[1] = temp->id[1];
T2->s_node = NULL;
T2->s_node = temp->s_node;
}
void insert_sol(StepNode* sol_node, int* grid_id, int priority = 0) {
Node* new_node = new Node;
new_node->priorty = priority;
new_node->s_node = sol_node;
new_node->id[0] = grid_id[0];
new_node->id[1] = grid_id[1];
new_node->next = NULL;
if (head == NULL) {
head = rear = new_node;
}
else {
rear->next = new_node;
rear = rear->next;
}
n_sols++;
}
StepNode* get_s_head() {
return s_head;
}
public:
DeepLearner() {
head = rear = NULL;
s_head = s_rear = in_game_traverser = NULL;
n_sols = step_no = 0;
}
//INSERT_STEP: EACH STEP IS TO BE ADDED AS THE GAME IS PLAYED SO THAT THE SOLUTION IS BEING SAVED IN REAL TIME
void insert_step(int row, int col) {
StepNode* new_node = new StepNode;
new_node->col = col;
new_node->row = row;
new_node->step = step_no;
new_node->s_next = NULL;
step_no++;
if (s_head == NULL) {
s_head = s_rear = new_node;
}
else {
s_rear->s_next = new_node;
s_rear = s_rear->s_next;
}
}
void sort_sol() {//TO SORT THE SOLUTIONS BY PRIORITY
Node* traverser = head, * temp = NULL;
int flagger = 0;
while (traverser != NULL) {
temp = traverser;
flagger = 0;
while (temp != NULL) {
if (temp->next != NULL) {
if (temp->priorty < temp->next->priorty) {
swap_sol(temp, temp->next);
flagger = 1;
}
}
temp = temp->next;
}
if (flagger == 0)break;
traverser = traverser->next;
}
}
void unique_sol_tester(int* grid_id) {//IF A UNIQUE SOLUTION EXISTS THEN IT IS ADDED TO THE DATASET
Node* temp = head;
int* flag1 = new int[1]{ -1 };
if (n_sols > 0)flag1 = new int[n_sols] {0};
int if_exists[16] = { 0 };
int i = 0;
while (temp != NULL) {
int j = 0;
StepNode* s_temp = s_head;
StepNode* s_temp2 = temp->s_node;
while (s_temp != NULL && s_temp2 != NULL)
{
if ((s_temp->row == s_temp2->row) && (s_temp->col == s_temp2->col)) { if_exists[j]++; }//TO CHECK FOR EXISTING SOLUTION
if ((s_temp->row != s_temp2->row) || (s_temp->col != s_temp2->col)) {
if (flag1[0] != -1) {
flag1[i] = 1;
break;
}
}//TO CHECK FOR UNIQUE SOLUTION
s_temp = s_temp->s_next;
s_temp2 = s_temp2->s_next;
j++;
}
if (flag1[i] == 1)break;
if (true) {// IF A SIMILAR SOLUTION EXISTS THEN ITS PRIORITY INCREASES
int checker = 0;
for (int k = 0; k < 16; k++) {
if (if_exists[k] == 0) { checker = 1; break; }
}
if (checker != 1 && flag1[i]!=1) {
temp->priorty++;
this->sort_sol();
s_head = s_rear = NULL;
step_no = 0;
return;
}
for (int k = 0; k < 16; k++)if_exists[k] = 0;
}
i++;
temp = temp->next;
}
if (flag1[0] != -1) {
for (int j = 0; j < 16; j++) {
if (flag1[j] == 0) { flag1[0] = 2; break; }
}
if (flag1[0] == 1) {
this->insert_sol(s_head, grid_id);
}
}
else {
this->insert_sol(s_head, grid_id);
}
s_head = s_rear = NULL;
step_no = 0;
}
void set_n_sols(int n_sols) {
this->n_sols = n_sols;
}
void display() {
StepNode* display_tra = head->s_node;
while (display_tra != NULL) {
cout << display_tra->row << " " << display_tra->col << endl;
display_tra = display_tra->s_next;
}
}
void clear_s_heads() {
s_head = s_rear = in_game_traverser = NULL;
step_no = 0;
}
friend class GameLogic;
};
class GameLogic {
DeepLearner* solution_dataset;
int* grid_id;
bool flag;
char** game_board;
char** board_interface;
int* arr_r_c;
char cross, circle;
int* get_step() {
int* arr = new int[2];
arr[0] = solution_dataset->in_game_traverser->row;
arr[1] = solution_dataset->in_game_traverser->col;
solution_dataset->in_game_traverser = solution_dataset->in_game_traverser->s_next;
return arr;
}
int* cpu_reigns_back(char** board) {
int* arr = new int[2]{ 0 };
for (int i = 0; i < 4; i++) {
//Row Checker
if (board[i][0] == board[i][1] && board[i][1] == board[i][2] && board[i][3] == '-' && board[i][0] != '-') { arr[0] = i; arr[1] = 3; flag = true; return arr; }
else if (board[i][0] == board[i][1] && board[i][1] == board[i][3] && board[i][2] == '-' && board[i][0] != '-') { arr[0] = i; arr[1] = 2; flag = true; return arr; }
else if (board[i][0] == board[i][2] && board[i][2] == board[i][3] && board[i][1] == '-' && board[i][0] != '-') { arr[0] = i; arr[1] = 1; flag = true; return arr; }
else if (board[i][1] == board[i][2] && board[i][2] == board[i][3] && board[i][0] == '-' && board[i][1] != '-') { arr[0] = i; arr[1] = 0; flag = true; return arr; }
//Column Checker
if (board[0][i] == board[1][i] && board[1][i] == board[2][i] && board[3][i] == '-' && board[0][i] != '-') { arr[0] = 3; arr[1] = i; flag = true; return arr; }
else if (board[0][i] == board[1][i] && board[1][i] == board[3][i] && board[2][i] == '-' && board[0][i] != '-') { arr[0] = 2; arr[1] = i; flag = true; return arr; }
else if (board[0][i] == board[2][i] && board[2][i] == board[3][i] && board[1][i] == '-' && board[0][i] != '-') { arr[0] = 1; arr[1] = i; flag = true; return arr; }
else if (board[1][i] == board[2][i] && board[2][i] == board[3][i] && board[0][i] == '-' && board[1][i] != '-') { arr[0] = 0; arr[1] = i; flag = true; return arr; }
}
//Diagonal Checker
int i = 0;
if (board[i][i] == board[i + 1][i + 1] && board[i + 1][i + 1] == board[i + 2][i + 2] && board[i + 3][i + 3] == '-' && board[i][i] != '-') { arr[0] = arr[1] = 3; flag = true; return arr; }
else if (board[i][i] == board[i + 1][i + 1] && board[i + 1][i + 1] == board[i + 3][i + 3] && board[i + 2][i + 2] == '-' && board[i][i] != '-') { arr[0] = arr[1] = 2; flag = true; return arr; }
else if (board[i][i] == board[i + 2][i + 2] && board[i + 2][i + 2] == board[i + 3][i + 3] && board[i + 1][i + 1] == '-' && board[i][i] != '-') { arr[0] = arr[1] = 1; flag = true; return arr; }
else if (board[i + 1][i + 1] == board[i + 2][i + 2] && board[i + 2][i + 2] == board[i + 3][i + 3] && board[i][i] == '-' && board[i][i] != '-') { arr[0] = arr[1] = 0; flag = true; return arr; }
//Reverse Diagonal Checker
if (board[i + 3][i] == board[i + 2][i + 1] && board[i + 2][i + 1] == board[i + 1][i + 2] && board[i][i + 3] == '-' && board[i + 3][i] != '-') { arr[0] = 0; arr[1] = 3; flag = true; return arr; }
else if (board[i + 3][i] == board[i + 2][i + 1] && board[i + 2][i + 1] == board[i][i + 3] && board[i + 1][i + 2] == '-' && board[i + 3][i] != '-') { arr[0] = 1; arr[1] = 2; flag = true; return arr; }
else if (board[i + 3][i] == board[i + 1][i + 2] && board[i + 1][i + 2] == board[i][i + 3] && board[i + 2][i + 1] == '-' && board[i + 3][i] != '-') { arr[0] = 2; arr[1] = 1; flag = true; return arr; }
else if (board[i + 2][i + 1] == board[i + 1][i + 2] && board[i + 1][i + 2] == board[i][i + 3] && board[i + 2][i + 1] == '-' && board[i + 2][i + 1] != '-') { arr[0] = 3; arr[1] = 0; flag = true; return arr; }
arr[0] = -1;
arr[1] = -1;
return arr;
}
int check_winner(char** board) {
if (board[0][0] == board[0][1] && board[0][1] == board[0][2] && board[0][2] == board[0][3] && board[0][0] != '-') {
if (board[0][0] == 'X')return 1;
else if (board[0][0] == 'O')return 2;
}
else if (board[1][0] == board[1][1] && board[1][1] == board[1][2] && board[1][2] == board[1][3] && board[1][0] != '-') {
if (board[1][0] == 'X')return 1;
else if (board[1][0] == 'O')return 2;
}
else if (board[2][0] == board[2][1] && board[2][1] == board[2][2] && board[2][2] == board[2][3] && board[2][0] != '-') {
if (board[2][0] == 'X')return 1;
else if (board[2][0] == 'O')return 2;
}
else if (board[3][0] == board[3][1] && board[3][1] == board[3][2] && board[3][2] == board[3][3] && board[3][0] != '-') {
if (board[3][0] == 'X')return 1;
else if (board[3][0] == 'O')return 2;
}
if (board[0][0] == board[1][0] && board[1][0] == board[2][0] && board[2][0] == board[3][0] && board[0][0] != '-') {
if (board[0][0] == 'X')return 1;
else if (board[0][0] == 'O')return 2;
}
else if (board[0][1] == board[1][1] && board[1][1] == board[2][1] && board[2][1] == board[3][1] && board[0][1] != '-') {
if (board[0][1] == 'X')return 1;
else if (board[0][1] == 'O')return 2;
}
else if (board[0][2] == board[1][2] && board[1][2] == board[2][2] && board[2][2] == board[3][2] && board[0][2] != '-') {
if (board[0][2] == 'X')return 1;
else if (board[0][2] == 'O')return 2;
}
else if (board[0][3] == board[1][3] && board[1][3] == board[2][3] && board[2][3] == board[3][3] && board[0][3] != '-') {
if (board[0][3] == 'X')return 1;
else if (board[0][3] == 'O')return 2;
}
if (board[0][0] == board[1][1] && board[1][1] == board[2][2] && board[2][2] == board[3][3]) {
if (board[0][0] == 'X')return 1;
else if (board[0][0] == 'O')return 2;
}
if (board[0][3] == board[1][2] && board[1][2] == board[2][1] && board[2][1] == board[3][0]) {
if (board[0][3] == 'X')return 1;
else if (board[0][3] == 'O')return 2;
}
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
if (board[i][j] == '-')return 3;
}
}
return 0;
}
int* get_indexes(int in_game_row, int in_game_col) {
if (in_game_row == 1)in_game_row = 0;
else if (in_game_row == 2)in_game_row = 2;
else if (in_game_row == 3)in_game_row = 4;
else if (in_game_row == 4)in_game_row = 6;
if (in_game_col == 1)in_game_col = 2;
else if (in_game_col == 2)in_game_col = 6;
else if (in_game_col == 3)in_game_col = 10;
else if (in_game_col == 4)in_game_col = 14;
int* indexes = new int[2];
indexes[0] = in_game_row;
indexes[1] = in_game_col;
return indexes;
}
void add_solution() {
solution_dataset->unique_sol_tester(grid_id);
}
void activator(int grid_row, int grid_col) {
solution_dataset->s_head = solution_dataset->s_rear = solution_dataset->in_game_traverser = NULL;
grid_id[0] = grid_row;
grid_id[1] = grid_col;
Node* temp = solution_dataset->head;
int flag = 0;
while (temp != NULL) {
solution_dataset->in_game_traverser = temp->s_node;
if (temp->id[0] == grid_row && temp->id[1] == grid_col) {
solution_dataset->in_game_traverser = temp->s_node;
return;
}
temp = temp->next;
}
}
int* in_game_logic(char** board) {//WILL USE GET_STEP
int row = 0, col = 0, step = 0, * arr = new int[2]{ 0 };
arr = this->cpu_reigns_back(board);
if (flag == true) {
flag = false;
return arr;
}
arr = new int[2]{ 0 };
if (solution_dataset->in_game_traverser != NULL) {
row = solution_dataset->in_game_traverser->row;
col = solution_dataset->in_game_traverser->col;
step = solution_dataset->in_game_traverser->step;
if (board[row][col] == '-') {//THIS CONDITION SHOULD BE ALTERED TO THE SPECIFIC BOARD CONDITION
solution_dataset->in_game_traverser->s_next;
arr[0] = row;
arr[1] = col;
solution_dataset->insert_step(row, col);
return arr;
}
else {
Node* temp = solution_dataset->head;
while (temp != NULL) {
StepNode* s_temp = temp->s_node;
while (s_temp != NULL) {
if (s_temp->step == step) {
if (board[s_temp->row][s_temp->col] == '-') {
solution_dataset->in_game_traverser = s_temp->s_next;
arr[0] = s_temp->row;
arr[1] = s_temp->col;
solution_dataset->insert_step(row, col);
return arr;
}
break;
}
s_temp = s_temp->s_next;
}
temp = temp->next;
}
}
}
srand(time(0));
row = 1 + (rand() % 4);
col = 1 + (rand() % 4);
if (board[row][col] != '-') { row = 0; col = 0; }//IF THE RANDOM ROW AND COL ARE OCCUPIED THEN A LOOP INITIATOR
for (int i = 0; i < 19; i++) {
if (board[row][col] == '-') {
arr[0] = row;
arr[1] = col;
solution_dataset->insert_step(row, col);
return arr;
}
else if (col < 4) { col++; }
else { col = 0; row++; }
}
arr[0] = -1;
arr[1] = -1;
return arr;
}
void save_highscore(char name[], int score) {
fstream file("highscores.BIN", ios::app | ios::binary);
file.seekp(0, ios::end);
for (int i = 0; i < 10; i++) {
file << name[i];
}
name[0] = 245;
file << " ";
file << name[0] << " " << score << endl;
file.close();
}
void save_solutions(StepNode* solution, int* starting_grid) {
fstream file("solutions.BIN", ios::app | ios::binary);
if (!file) { cout << "Can't open File!" << endl; return; }
file.seekp(0, ios::end);
file << starting_grid[0] << " " << starting_grid[1] << " ";
while (solution->s_next != NULL) {
file << solution->row << " " << solution->col << ",";
solution = solution->s_next;
}
file << solution->row << " " << solution->col << ";";
file.close();
}
int get_highscore(int start_time, int end_time) {
int game_time = end_time - start_time;
int game_points = 10000;
game_points /= game_time;
return game_points;
}
public:
GameLogic() {
flag = false;
grid_id = new int[2]{ 0 };
solution_dataset = new DeepLearner;
cross = 'X';
circle = 'O';
arr_r_c = new int[2]{ 0 };
game_board = new char* [4];
for (int i = 0; i < 4; i++) {
game_board[i] = new char[4];
for (int j = 0; j < 4; j++) {
game_board[i][j] = '-';
}
}
board_interface = new char* [8];
for (int i = 0, k = 0; i < 8; i++) {
board_interface[i] = new char[16];
for (int j = 0; j < 16; j++) {
if (j == 4 || j == 8 || j == 12) {
board_interface[i][j] = 245;
continue;
}
if (j == 0 && i % 2 != 0) {
board_interface[i][j] = i + 48 - k;
k++;
}
else if (i % 2 == 0 || i >= 7) {
board_interface[i][j] = ' ';
}
else if (i < 7) {
board_interface[i][j] = '_';
}
}
}
grid_id[0] = 0; grid_id[1] = 0;
solution_dataset->insert_step(1, 0);
solution_dataset->insert_step(1, 1);
solution_dataset->insert_step(2, 3);
solution_dataset->insert_step(0, 1);
solution_dataset->insert_step(3, 0);
solution_dataset->insert_step(2, 2);
solution_dataset->insert_step(1, 2);
solution_dataset->insert_step(2, 0);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->clear_s_heads();
grid_id[0] = 0; grid_id[1] = 1;
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(3, 0);
solution_dataset->insert_step(3, 1);
solution_dataset->insert_step(0, 3);
solution_dataset->insert_step(1, 0);
solution_dataset->insert_step(2, 1);
solution_dataset->insert_step(1, 1);
solution_dataset->insert_step(0, 2);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->clear_s_heads();
grid_id[0] = 0; grid_id[1] = 2;
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(2, 0);
solution_dataset->insert_step(1, 2);
solution_dataset->insert_step(3, 0);
solution_dataset->insert_step(0, 1);
solution_dataset->insert_step(0, 3);
solution_dataset->insert_step(1, 3);
solution_dataset->insert_step(2, 3);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->clear_s_heads();
grid_id[0] = 0; grid_id[1] = 3;
solution_dataset->insert_step(1, 1);
solution_dataset->insert_step(1, 0);
solution_dataset->insert_step(2, 1);
solution_dataset->insert_step(0, 1);
solution_dataset->insert_step(3, 2);
solution_dataset->insert_step(1, 3);
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(2, 3);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->clear_s_heads();
grid_id[0] = 1; grid_id[1] = 0;
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(0, 1);
solution_dataset->insert_step(0, 2);
solution_dataset->insert_step(1, 2);
solution_dataset->insert_step(3, 3);
solution_dataset->insert_step(3, 1);
solution_dataset->insert_step(2, 2);
solution_dataset->insert_step(2, 3);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->clear_s_heads();
grid_id[0] = 1; grid_id[1] = 1;
solution_dataset->insert_step(2, 0);
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(1, 2);
solution_dataset->insert_step(3, 1);
solution_dataset->insert_step(1, 2);
solution_dataset->insert_step(3, 3);
solution_dataset->insert_step(3, 0);
solution_dataset->insert_step(2, 2);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->n_sols++;
grid_id[0] = 1; grid_id[1] = 2;
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(1, 0);
solution_dataset->insert_step(2, 2);
solution_dataset->insert_step(3, 0);
solution_dataset->insert_step(1, 3);
solution_dataset->insert_step(0, 2);
solution_dataset->insert_step(0, 1);
solution_dataset->insert_step(2, 3);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->n_sols++;
grid_id[0] = 1; grid_id[1] = 3;
solution_dataset->insert_step(1, 1);
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(2, 1);
solution_dataset->insert_step(1, 1);
solution_dataset->insert_step(0, 3);
solution_dataset->insert_step(3, 0);
solution_dataset->insert_step(2, 2);
solution_dataset->insert_step(3, 3);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->n_sols++;
grid_id[0] = 2; grid_id[1] = 0;
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(1, 0);
solution_dataset->insert_step(2, 1);
solution_dataset->insert_step(0, 1);
solution_dataset->insert_step(1, 1);
solution_dataset->insert_step(3, 2);
solution_dataset->insert_step(1, 3);
solution_dataset->insert_step(0, 2);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->n_sols++;
grid_id[0] = 2; grid_id[1] = 1;
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(1, 0);
solution_dataset->insert_step(2, 0);
solution_dataset->insert_step(0, 3);
solution_dataset->insert_step(2, 2);
solution_dataset->insert_step(0, 1);
solution_dataset->insert_step(3, 2);
solution_dataset->insert_step(3, 1);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->n_sols++;
grid_id[0] = 2; grid_id[1] = 2;
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(1, 0);
solution_dataset->insert_step(1, 2);
solution_dataset->insert_step(1, 1);
solution_dataset->insert_step(2, 3);
solution_dataset->insert_step(3, 2);
solution_dataset->insert_step(0, 1);
solution_dataset->insert_step(2, 0);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->n_sols++;
grid_id[0] = 2; grid_id[1] = 3;
solution_dataset->insert_step(2, 1);
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(3, 3);
solution_dataset->insert_step(1, 0);
solution_dataset->insert_step(3, 0);
solution_dataset->insert_step(3, 1);
solution_dataset->insert_step(0, 2);
solution_dataset->insert_step(0, 1);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->n_sols++;
grid_id[0] = 3; grid_id[1] = 0;
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(0, 1);
solution_dataset->insert_step(2, 1);
solution_dataset->insert_step(3, 1);
solution_dataset->insert_step(1, 0);
solution_dataset->insert_step(1, 3);
solution_dataset->insert_step(3, 2);
solution_dataset->insert_step(0, 2);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->n_sols++;
grid_id[0] = 3; grid_id[1] = 1;
solution_dataset->insert_step(3, 0);
solution_dataset->insert_step(0, 0);
solution_dataset->insert_step(1, 0);
solution_dataset->insert_step(2, 1);
solution_dataset->insert_step(0, 3);
solution_dataset->insert_step(3, 2);
solution_dataset->insert_step(2, 3);
solution_dataset->insert_step(3, 3);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->n_sols++;
grid_id[0] = 3; grid_id[1] = 2;
solution_dataset->insert_step(1, 0);
solution_dataset->insert_step(3, 0);
solution_dataset->insert_step(1, 2);
solution_dataset->insert_step(1, 1);
solution_dataset->insert_step(2, 0);
solution_dataset->insert_step(3, 1);
solution_dataset->insert_step(0, 1);
solution_dataset->insert_step(0, 2);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->n_sols++;
grid_id[0] = 3; grid_id[1] = 3;
solution_dataset->insert_step(2, 1);
solution_dataset->insert_step(2, 3);
solution_dataset->insert_step(3, 0);
solution_dataset->insert_step(1, 1);
solution_dataset->insert_step(0, 2);
solution_dataset->insert_step(3, 2);
solution_dataset->insert_step(2, 1);
solution_dataset->insert_step(1, 3);
solution_dataset->insert_sol(solution_dataset->s_head, grid_id);
solution_dataset->n_sols++;
}
void load_solutions(){
fstream file("solutions.BIN", ios::in | ios::binary);
if (!file) { cout << "Can't open File!" << endl; return; }
int* start_grid = new int[2]{ 0 };
string data;
bool flagger = true;
while (!file.eof()) {
getline(file, data);
start_grid[0] = data[0] - 48;
start_grid[1] = data[2] - 48;
int row_step = 0, col_step = 0;
for (unsigned i = 4; i < data.length(); i+=2) {
if (flagger == true) {
solution_dataset->insert_step(data[i] - 48, data[i + 2] - 48);
flagger = false;
}
else {
flagger = true;
}
}
solution_dataset->unique_sol_tester(start_grid);
}
file.close();
}
void read_highscores() {
string data;
fstream file("highscores.BIN", ios::in);
file.seekg(0, ios::beg);
if (!file) { cout << "File not found!" << endl; return; }
cout << "\n\n\n\t\t\t HIGH-SCORES" << endl << endl;;
while (!file.eof()) {
getline(file, data);
cout << "\t\t\t" << data << endl;
}
file.close();
}
void input() {
int winner = 0, input_row = 0, input_col = 0;
int* player_start_grid = new int[2]{ 0 };
int* opponent_start_grid = new int[2]{ 0 };
bool first = true;
time_t start_time, end_time;
start_time = time(NULL);
DeepLearner player_sol;
DeepLearner opponent_sol;
while (true) {
ask_again:
system("cls");
cout << "\n\n\n\t\t\t\t4X4 Tic-Tac-Toe\n\n" << "\t\t\t\t 1 2 3 4" << endl;
print_interface_board();
cout << "\n\n\t\t\tEnter row number: "; cin >> input_row;
cout << "\t\t\tEnter column number: "; cin >> input_col;
if (input_row > 0 && input_row < 5 && input_col > 0 && input_col < 5 && game_board[input_row - 1][input_col - 1] == '-') {
if (first == true) {
activator(input_row - 1, input_col - 1);
player_start_grid[0] = input_row - 1;
player_start_grid[1] = input_col - 1;
}
game_board[input_row - 1][input_col - 1] = cross;
player_sol.insert_step(input_row - 1, input_col - 1);
arr_r_c = get_indexes(input_row, input_col);
board_interface[arr_r_c[0]][arr_r_c[1]] = cross;
}
else {
cout << "\n\t\t\t\tWrong input" << endl << "\n\t\t\t";
system("pause");
goto ask_again;
}
arr_r_c = in_game_logic(game_board);
game_board[arr_r_c[0]][arr_r_c[1]] = circle;
if (first == true) {
first = false;
opponent_start_grid[0] = arr_r_c[0];
opponent_start_grid[1] = arr_r_c[1];
}
opponent_sol.insert_step(arr_r_c[0], arr_r_c[1]);
arr_r_c = get_indexes(arr_r_c[0] + 1, arr_r_c[1] + 1);
board_interface[arr_r_c[0]][arr_r_c[1]] = circle;
winner = check_winner(game_board);
if (winner == 1) {
end_time = time(NULL);
cout << "\n\t\t\t\tYou Won the game!" << endl << endl;
char name[10] = " ";
string data;
cout << "\t\t\tEnter name: "; cin >> data;
for (unsigned i = 0; i < data.length() && i < 10; i++) {
name[i] = data[i];
}
save_highscore(name, get_highscore(start_time, end_time));
system("cls");
cout << endl << endl;
read_highscores();
cout << "\t\t\t";
system("pause");
solution_dataset->clear_s_heads();
save_solutions(player_sol.get_s_head(), opponent_start_grid);
solution_dataset->unique_sol_tester(opponent_start_grid);
break;
}
else if (winner == 2) {
end_time = time(NULL);
cout << "\n\t\t\t\tBot won the game" << endl << "\t\t\t";
system("pause");
solution_dataset->clear_s_heads();
save_solutions(opponent_sol.get_s_head(), player_start_grid);
solution_dataset->unique_sol_tester(player_start_grid);
break;
}
else if (winner == 0) {
end_time = time(NULL);
cout << "\n\t\t\t\tDraw!" << endl << "\t\t\t";
system("pause");
solution_dataset->clear_s_heads();
solution_dataset->insert_sol(opponent_sol.get_s_head(), opponent_start_grid);
solution_dataset->unique_sol_tester(opponent_start_grid);
break;
}
}
system("cls");
}
void print_game_board() {
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
cout << game_board[i][j];
}
cout << endl;
}
}
void print_interface_board() {
for (int i = 0; i < 8; i++) {
cout << "\t\t\t\t";
for (int j = 0; j < 16; j++) {
cout << board_interface[i][j];
if (j == 0) { cout << " "; }
}
cout << endl;
}
}
};
int main()
{
//make menu here;
int choice=404;
while (true) {
screenheader();
cout << "\n\n\t\t\t\t1.LOGIN" << endl;
cout << "\t\t\t\t2.REGISTER" << endl;
cout << "\t\t\t\t3.Exit" << endl;
cout << "\n\t\t\t\tEnter your choice :";
cin >> choice;
cout << endl;
switch (choice)
{
case 1: {
int check=login();
if (check != 1)break;
int c;
while (1)
{
system("cls");
c = menu();
if (c == 1)
{
GameLogic caller;
caller.load_solutions();
caller.input();
}
if (c == 2)
{
string name1, name2;
system("cls");
cout << "\n\t\t\tENTER PLAYER 1'S NAME: ";
cin >> name1;
cout << "\t\t\tENTER PLAYER 2'S NAME: ";
cin >> name2;
multi* m;
m = new multi(name1, name2);
m->engine();
}
else if (c == 3)
{
system("cls");
GameLogic loader;
loader.read_highscores();
cout << "\t\t\t";
system("pause");
}
else if (c == 4)
{
howtoplay();
}
else if (c == 5)
{
char d_check = 'n';
system("cls");
cout << "\n\n\n\t\t\tAre you sure you want to exit? (Y/N)"; cin >> d_check;
if (d_check == 'Y' || d_check == 'y')
{
system("cls");
exit(0);
}
else {
system("cls");
}
}
else if (c < 1 || c>5)
{
cout << "\n\t\t\t\tWRONG CHOICE\n\t\t\t\t";
system("pause");
}
}
break;
}
case 2:
registr();
break;
case 3:{
char d_check = 'n';
system("cls");
cout << "\n\n\n\t\t\tAre you sure you want to exit? (Y/N)"; cin >> d_check;
if (d_check == 'Y' || d_check == 'y')
{
system("cls");
exit(0);
}
else {
system("cls");
}
break;
}
default: {
system("cls");
cout << "\n\n\n\t\t\t\t";
cout << "You've made a mistake , give it another try again\n" << endl<<"\t\t\t\t";
system("pause");
}
}
}
}
|
/*************************************************************
* > File Name : U78300.cpp
* > Author : Tony
* > Created Time : 2019/08/13 16:01:08
* > Algorithm : 模拟
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define debug(x) cerr << #x << " = " << x << endl
inline int read() {
int x = 0; int f = 1; char ch = getchar();
while (!isdigit(ch)) {if (ch == '-') f = -1; ch = getchar();}
while (isdigit(ch)) {x = x * 10 + ch - 48; ch = getchar();}
return x * f;
}
const int maxn = 110;
int n, t;
struct Airplane {
int x, y, z;
int h, f;
int atk, def, mat, mdf;
int hp, fix;
int act[maxn];
}p[maxn];
struct Direct {
int x, y, z;
};
Direct HFtoDirect(int h, int f) {
if (h == 0) {
return (Direct){0, 0, -1};
} else if (h == 4) {
return (Direct){0, 0, 1};
} else {
if (h == 1) {
if (f == 0) {
return (Direct){1, 0, -1};
} else if (f == 1) {
return (Direct){1, 1, -1};
} else if (f == 2) {
return (Direct){0, 1, -1};
} else if (f == 3) {
return (Direct){-1, 1, -1};
} else if (f == 4) {
return (Direct){-1, 0, -1};
} else if (f == 5) {
return (Direct){-1, -1, -1};
} else if (f == 6) {
return (Direct){0, -1, -1};
} else if (f == 7) {
return (Direct){1, -1, -1};
}
} else if (h == 2) {
if (f == 0) {
return (Direct){1, 0, 0};
} else if (f == 1) {
return (Direct){1, 1, 0};
} else if (f == 2) {
return (Direct){0, 1, 0};
} else if (f == 3) {
return (Direct){-1, 1, 0};
} else if (f == 4) {
return (Direct){-1, 0, 0};
} else if (f == 5) {
return (Direct){-1, -1, 0};
} else if (f == 6) {
return (Direct){0, -1, 0};
} else if (f == 7) {
return (Direct){1, -1, 0};
}
} else if (h == 3) {
if (f == 0) {
return (Direct){1, 0, 1};
} else if (f == 1) {
return (Direct){1, 1, 1};
} else if (f == 2) {
return (Direct){0, 1, 1};
} else if (f == 3) {
return (Direct){-1, 1, 1};
} else if (f == 4) {
return (Direct){-1, 0, 1};
} else if (f == 5) {
return (Direct){-1, -1, 1};
} else if (f == 6) {
return (Direct){0, -1, 1};
} else if (f == 7) {
return (Direct){1, -1, 1};
}
}
}
}
void read_data() {
n = read(); t = read();
for (int i = 1; i <= n; ++i) {
p[i].x = read();
p[i].y = read();
p[i].z = read();
p[i].h = read();
p[i].f = read();
p[i].atk = read();
p[i].def = read();
p[i].mat = read();
p[i].mdf = read();
p[i].hp = read();
p[i].fix = read();
char ch[maxn];
scanf("%s", ch + 1);
for (int j = 1; j <= t; ++j) {
if (ch[j] == 'N') p[i].act[j] = 0;
else if (ch[j] == 'U') p[i].act[j] = 1;
else if (ch[j] == 'D') p[i].act[j] = 2;
else if (ch[j] == 'L') p[i].act[j] = 3;
else if (ch[j] == 'R') p[i].act[j] = 4;
else if (ch[j] == 'F') p[i].act[j] = 5;
else if (ch[j] == 'A') p[i].act[j] = 6;
else if (ch[j] == 'M') p[i].act[j] = 7;
}
}
}
void Move(int num) {
Direct dir = HFtoDirect(p[num].h, p[num].f);
p[num].x += dir.x;
p[num].y += dir.y;
p[num].z += dir.z;
}
void A(int num) {
int lenm = -1, goal = num;
for (int i = 1; i <= n; ++i) {
if (i == num) continue;
int dx = p[i].x - p[num].x;
int dy = p[i].y - p[num].y;
int dz = p[i].z - p[num].z;
Direct dir = HFtoDirect(p[num].h, p[num].f);
if ((dx == 0 && dir.x != 0) || (dy == 0 && dir.y != 0) || (dz == 0 && dir.z != 0)) continue;
int kx = dir.x / dx, ky = dir.y / dy, kz = dir.z / dy;
if (kx != ky || kx != kz || ky != kz || kx <= 0) continue;
int len = dx * dx + dy * dy + dz * dz;
if (len < lenm) goal = i;
}
if (goal != num) {
int hurt = p[num].atk - p[goal].def;
if (hurt > 0) {
p[goal].hp -= hurt;
if (p[goal].hp < 0) p[goal].hp = 0;
}
}
}
void M(int num) {
int lenm = -1, cnt = 0;
int goal[maxn];
for (int i = 1; i <= n; ++i) {
if (i == num) continue;
int dx = p[i].x - p[num].x;
int dy = p[i].y - p[num].y;
int dz = p[i].z - p[num].z;
Direct dir = HFtoDirect(p[num].h, p[num].f);
if ((dx == 0 && dir.x != 0) || (dy == 0 && dir.y != 0) || (dz == 0 && dir.z != 0)) continue;
int kx = dir.x / dx, ky = dir.y / dy, kz = dir.z / dy;
if (kx != ky || kx != kz || ky != kz || kx <= 0) continue;
goal[++cnt] = i;
}
for (int i = 1; i <= cnt; ++i) {
int hurt = p[num].mat - p[goal[i]].mdf;
if (hurt > 0) {
p[goal[i]].hp -= hurt;
if (p[goal[i]].hp < 0) p[goal[i]].hp = 0;
}
}
}
void Act(int num, int dt) {
if (p[num].act[dt] == 0) return;
if (p[num].act[dt] == 1) {
if (p[num].h == 4) return;
p[num].h += 1;
} else if (p[num].act[dt] == 2) {
if (p[num].h == 0) return;
p[num].h -= 1;
} else if (p[num].act[dt] == 3) {
if (p[num].f == 7) p[num].f = 0;
else p[num].f += 1;
} else if (p[num].act[dt] == 4) {
if (p[num].f == 0) p[num].f = 7;
else p[num].f -= 1;
} else if (p[num].act[dt] == 5) {
p[num].hp += p[num].fix;
} else if (p[num].act[dt] == 6) {
A(num);
} else if (p[num].act[dt] == 7) {
M(num);
}
}
int main() {
read_data();
for (int dt = 1; dt <= t; ++dt) {
for (int num = 1; num <= n; ++num) {
if (p[num].hp <= 0) continue;
Move(num);
}
for (int num = 1; num <= n; ++num) {
if (p[num].hp <= 0) continue;
Act(num, dt);
}
}
for (int i = 1; i <= n; ++i) {
printf("%d %d %d %d\n", p[i].x, p[i].y, p[i].z, p[i].hp);
}
return 0;
}
|
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QQmlContext>
int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
QGuiApplication app(argc, argv);
qmlRegisterSingletonType(QUrl("qrc:///Utility/Uuid.qml"), "Variable.Global", 1, 0, "Uuid");
qmlRegisterSingletonType(QUrl("qrc:///Utility/Skin.qml"), "Variable.Global", 1, 0, "Skin");
app.setOrganizationName("ossia.io");
app.setOrganizationDomain("Remote Control");
QQmlApplicationEngine engine;
const bool debugEnabled = qEnvironmentVariableIntValue("SCORE_QML_REMOTE_DEBUG") > 0;
engine.rootContext()->setContextProperty("g_debugMessagesEnabled", debugEnabled);
// The timeline it does not appear on the screen when the application
// is used on a device other than the computer
const bool tmp_is_mobile = qEnvironmentVariableIsSet("IS_MOBILE") ? qEnvironmentVariableIntValue("IS_MOBILE") > 0 : false;
engine.rootContext()->setContextProperty("is_mobile", tmp_is_mobile);
const QUrl url(QStringLiteral("qrc:/main.qml"));
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl)
QCoreApplication::exit(-1);
}, Qt::QueuedConnection);
engine.load(url);
return app.exec();
}
|
#ifndef CELLO_ACTION_SEQUENCE_H
#define CELLO_ACTION_SEQUENCE_H
#include <algorithm>
#include <functional>
#include <initializer_list>
#include <queue>
#include <vector>
#include <util/Tweener.h>
#include <util/Action.h>
using std::function;
using std::initializer_list;
using std::queue;
using std::vector;
namespace cello
{
class ActionSequence
{
public:
ActionSequence() : _currentAction(nullptr), _finished(false)
{
_finished = false;
}
void add(Action* action)
{
// Clear finished flag if action is added after flag is set
_finished = false;
_actionQueue.push(action);
action->onAdded(&_tweener);
}
virtual void update(float elapsedTime)
{
if (!_currentAction)
{
if (_actionQueue.size() == 0) return;
// Set the next action as the current action
_currentAction = _actionQueue.front();
_currentAction->init();
}
_currentAction->update(elapsedTime);
if (_currentAction->isFinished())
{
_actionQueue.pop();
delete _currentAction;
_currentAction = nullptr;
}
if (!_actionQueue.size())
{
_finished = true;
}
}
bool isFinished()
{
return _finished;
}
private:
queue<Action*> _actionQueue;
Action* _currentAction;
CDBTweener _tweener;
bool _finished;
};
}
#endif
|
#include "navigator.h"
#include "screenfactory.h"
using namespace screens;
FragmentNavigator::FragmentNavigator(
QStackedWidget *container,
BaseScreensFactory *screensFactory,
Resolver* resolver) : mResolver(resolver) {
this->screensFactory = screensFactory;
this->currentContainer = container;
BaseFragment* startFragment = getStartScreen();
connectFragment(resolver);
auto tmp = static_cast<LoginFragment*>(startFragment);
connect(mResolver, &Resolver::WrongDataAutorisation, tmp, &LoginFragment::WrongData, Qt::QueuedConnection);
this->stack.push_back(startFragment);
currentContainer->addWidget(stack.back());
currentContainer->setCurrentIndex(0);
}
FragmentNavigator::~FragmentNavigator() {
}
void FragmentNavigator::navigateTo(QString tag) {
qDebug("Navigator navigateTo");
BaseFragment *newFragment = this->screensFactory->create(tag);
stack.back()->onPause();
disconnectFragment(stack.back());
connectFragment(newFragment);
stack.push_back(newFragment);
if (tag == GAME_TAG) {
GameFragment* game = static_cast<GameFragment*>(newFragment);
connect(mResolver, &Resolver::DeletePlayer, game, &GameFragment::DeletePlayer, Qt::QueuedConnection);
connect(mResolver, &Resolver::DrawPlayer, game, &GameFragment::DrawPlayer, Qt::QueuedConnection);
connect(mResolver, &Resolver::SetMinBet, game, &GameFragment::SetMinBet, Qt::QueuedConnection);
connect(mResolver, &Resolver::SetMaxBet, game, &GameFragment::SetMaxBet, Qt::QueuedConnection);
connect(mResolver, &Resolver::EndGame, game, &GameFragment::EndGame, Qt::QueuedConnection);
connect(mResolver, &Resolver::FlipTableCards, game, &GameFragment::FlipTableCards, Qt::QueuedConnection);
connect(mResolver, &Resolver::DeleteAllCardsFromTable, game, &GameFragment::DeleteAllCardsFromTable, Qt::QueuedConnection);
connect(mResolver, &Resolver::AddCardToTable, game, &GameFragment::AddCardToTable, Qt::QueuedConnection);
connect(mResolver, &Resolver::FlipAllCards, game, &GameFragment::FlipAllCards, Qt::QueuedConnection);
connect(mResolver, &Resolver::ShowActions, game, &GameFragment::ShowActions, Qt::QueuedConnection);
connect(mResolver, &Resolver::BlockActions, game, &GameFragment::BlockActions, Qt::QueuedConnection);
connect(mResolver, &Resolver::UnBlockActions, game, &GameFragment::UnBlockActions, Qt::QueuedConnection);
connect(mResolver, &Resolver::ShowStart, game, &GameFragment::ShowStart, Qt::QueuedConnection);
connect(mResolver, &Resolver::MakeDealer, game, &GameFragment::MakeDealer, Qt::QueuedConnection);
connect(mResolver, &Resolver::DisplayWinner, game, &GameFragment::DisplayWinner, Qt::QueuedConnection);
connect(mResolver, &Resolver::CurrentTurn, game, &GameFragment::CurrentTurn, Qt::QueuedConnection);
connect(mResolver, &Resolver::GiveCards, game, &GameFragment::GiveCards, Qt::QueuedConnection);
connect(mResolver, &Resolver::FlipCards, game, &GameFragment::FlipCards, Qt::QueuedConnection);
connect(mResolver, &Resolver::SetBet, game, &GameFragment::SetBet, Qt::QueuedConnection);
connect(mResolver, &Resolver::SetFold, game, &GameFragment::SetFold, Qt::QueuedConnection);
connect(mResolver, &Resolver::SetCall, game, &GameFragment::SetCall, Qt::QueuedConnection);
connect(mResolver, &Resolver::SetRaise, game, &GameFragment::SetRaise, Qt::QueuedConnection);
connect(mResolver, &Resolver::SetCheck, game, &GameFragment::SetCheck, Qt::QueuedConnection);
connect(mResolver, &Resolver::ClearStatus, game, &GameFragment::ClearStatus, Qt::QueuedConnection);
connect(mResolver, &Resolver::AvaliableActions, game, &GameFragment::AvaliableActions, Qt::QueuedConnection);
connect(mResolver, &Resolver::SetMoneyInBank, game, &GameFragment::SetMoneyInBank, Qt::QueuedConnection);
connect(mResolver, &Resolver::DeleteWinnerDisplay, game, &GameFragment::DeleteWinnerDisplay, Qt::QueuedConnection);
connect(mResolver, &Resolver::ClearBank, game, &GameFragment::ClearBank, Qt::QueuedConnection);
connect(mResolver, &Resolver::DeleteAllPlayersCards, game, &GameFragment::DeleteAllPlayersCards, Qt::QueuedConnection);
connect(mResolver, &Resolver::SetMoney, game, &GameFragment::SetMoney, Qt::QueuedConnection);
} else if (tag == REGISTRATION_TAG) {
RegistrationFragment* reg = static_cast<RegistrationFragment*>(newFragment);
connect(mResolver, &Resolver::WrongDataRegistration, reg, &RegistrationFragment::WrongDataRegistration, Qt::QueuedConnection);
connect(mResolver, &Resolver::RightDataRegistration, reg, &RegistrationFragment::RightDataRegistration, Qt::QueuedConnection);
} else if (tag == SEARCH_TAG) {
GameSearchFragment* src = static_cast<GameSearchFragment*>(newFragment);
connect(mResolver, &Resolver::WrongDataRoomJoin, src, &GameSearchFragment::WrongDataRoomJoin, Qt::QueuedConnection);
}
currentContainer->addWidget(newFragment);
currentContainer->setCurrentWidget(newFragment);
}
BaseFragment* FragmentNavigator::Front() {
return stack.front();
}
void FragmentNavigator::back() {
currentContainer->removeWidget(stack.back());
delete stack.back();
stack.pop_back();
connectFragment(stack.back());
stack.back()->onResume();
currentContainer->setCurrentWidget(stack.back());
}
void FragmentNavigator::newRootScreen(QString tag) {
BaseFragment *newFragment = this->screensFactory->create(tag);
disconnectFragment(stack.back());
stack.clear();
connectFragment(newFragment);
for(int i = currentContainer->count(); i >= 0; i--) {
QWidget* widget = currentContainer->widget(i);
currentContainer->removeWidget(widget);
widget->deleteLater();
}
currentContainer->addWidget(newFragment);
stack.push_back(newFragment);
}
BaseFragment* FragmentNavigator::getStartScreen() {
return createAndConnect(this->screensFactory->createStart());
}
void FragmentNavigator::connectFragment(BaseFragment *fragment) {
connect(fragment, &BaseFragment::back, this, &FragmentNavigator::back);
connect(fragment, &BaseFragment::navigateTo, this, &FragmentNavigator::navigateTo);
connect(fragment, &BaseFragment::newRootScreen, this, &FragmentNavigator::newRootScreen);
connect(fragment, &BaseFragment::Front, this, &FragmentNavigator::Front);
}
void FragmentNavigator::disconnectFragment(BaseFragment *fragment) {
disconnect(fragment, &BaseFragment::back, this, &FragmentNavigator::back);
disconnect(fragment, &BaseFragment::navigateTo, this, &FragmentNavigator::navigateTo);
disconnect(fragment, &BaseFragment::newRootScreen, this, &FragmentNavigator::newRootScreen);
disconnect(fragment, &BaseFragment::Front, this, &FragmentNavigator::Front);
}
BaseFragment* FragmentNavigator::createAndConnect(QString tag) {
BaseFragment *fragment = this->screensFactory->create(tag);
connectFragment(fragment);
return fragment;
}
|
#include "Run_time_Framework.h"
extern int kind;
CRun_time_Framework* CRun_time_Framework::myself = nullptr;
CRun_time_Framework::CRun_time_Framework() {
}
GLvoid CRun_time_Framework::draw() {
glClearColor(0, 0, 0, 1); // 바탕색을 지정
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // 설정된 색으로 전체를 칠하기
glEnable(GL_DEPTH_TEST); //깊이테스트
glDepthFunc(GL_LESS); //Passes if the fragment's depth value is less than the stored depth value.
glPushMatrix();
Draw_fonts();
glEnable(GL_LIGHTING);
GLfloat pos[] = { -500, 500, 400, 1.0 };
glLightfv(GL_LIGHT0, GL_POSITION, pos);
glEnable(GL_LIGHT0);
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
Draw_Shapes();
glDisable(GL_LIGHTING);
glPopMatrix();
glutSwapBuffers();
return GLvoid();
}
GLvoid CRun_time_Framework::Reshape(int w, int h) {
if (w > 0)
m_nWidth = w;
if (h > 0)
m_nHeight = h;
// 뷰포트 변환 설정: 출력 화면 결정
glViewport(0, 0, w, h);
// 클리핑 변환 설정: 출력하고자 하는 공간 결정
// 아래 3줄은 투영을 설정하는 함수
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
// 투영은 직각 투영 또는 원근 투영 중 한개를 설정한다.
// 원근 투영을 사용하는 경우:
//gluPerspective (60, (float)w / (float)h, 1, 5000);
//glTranslatef (0, 0, -400);
// 직각 투영인경우
glOrtho (-450.0, 450.0, -450.0, 450.0, -400, 400);
// 모델링 변환 설정: 디스플레이 콜백 함수에서 모델 변환 적용하기 위하여 Matrix mode 저장
glMatrixMode (GL_MODELVIEW);
// 관측 변환: 카메라의 위치 설정 (필요한 경우, 다른 곳에 설정 가능)
//gluLookAt(0.0, 0.0, camera_zoom, 0.0, 0.0, -100.0, 0.0, 1.0, 0.0);
return GLvoid();
}
GLvoid CRun_time_Framework::KeyboardDown(unsigned char key, int x, int y) {
switch (key) {
case '0':
sel = 0;
break;
case '1':
sel = 1;
break;
case '2':
sel = 2;
break;
case '3':
sel = 3;
break;
case '4':
sel = 4;
break;
case '5':
sel = 5;
break;
case '6':
sel = 6;
break;
case '7':
sel = 7;
break;
case '8':
sel = 8;
break;
case 'z':
shape[sel].alpha[0] += 0.1;
if (shape[sel].alpha[0] > 1)
shape[sel].alpha[0] = 1;
break;
case 'Z':
shape[sel].alpha[0] -= 0.1;
if (shape[sel].alpha[0] < 0)
shape[sel].alpha[0] = 0;
break;
case 'x':
shape[sel].alpha[1] += 0.1;
if (shape[sel].alpha[1] > 1)
shape[sel].alpha[1] = 1;
break;
case 'X':
shape[sel].alpha[1] -= 0.1;
if (shape[sel].alpha[1] < 0)
shape[sel].alpha[1] = 0;
break;
case 'c':
shape[sel].alpha[2] += 0.1;
if (shape[sel].alpha[2] > 1)
shape[sel].alpha[2] = 1;
break;
case 'C':
shape[sel].alpha[2] -= 0.1;
if (shape[sel].alpha[2] < 0)
shape[sel].alpha[2] = 0;
break;
}
}
GLvoid CRun_time_Framework::KeyboardUp(unsigned char key, int x, int y) {
switch (key) {
}
}
GLvoid CRun_time_Framework::Resize(int w, int h) {
if (!myself)
return GLvoid();
myself->Reshape(w, h);
}
GLvoid CRun_time_Framework::drawscene() {
if (myself != nullptr) {
myself->draw();
}
return GLvoid();
}
GLvoid CRun_time_Framework::KeyDowninput(unsigned char key, int x, int y) {
if (myself != nullptr) {
myself->KeyboardDown(key, x, y);
}
return GLvoid();
}
GLvoid CRun_time_Framework::KeyUpinput(unsigned char key, int x, int y) {
if (myself != nullptr) {
myself->KeyboardUp(key, x, y);
}
return GLvoid();
}
GLvoid CRun_time_Framework::Mouse(int button, int state, int x, int y) {
if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) {
}
return GLvoid();
}
GLvoid CRun_time_Framework::Mouseaction(int button, int state, int x, int y) {
if (myself != nullptr) {
myself->Mouse(button, state, x, y);
}
return GLvoid();
}
GLvoid CRun_time_Framework::Init() {
srand(time(NULL));
camera.zoom = 500;
camera.x = 0;
camera.y = 0;
for (int i = 0; i < 9; ++i) {
for (int j = 0; j < 3; ++j) {
shape[i].alpha[j] = rand() % 100;
shape[i].alpha[j] = shape[i].alpha[j] / 100.0;
}
}
sel = 0;
myself = this;
glutSetKeyRepeat(GLUT_KEY_REPEAT_OFF);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); // 디스플레이 모드 설정
glutInitWindowPosition(100, 100); // 윈도우의 위치지정
glutInitWindowSize(900, 900); // 윈도우의 크기 지정
glutCreateWindow("15"); // 윈도우 생성 (윈도우 이름)
glutDisplayFunc(drawscene); // 출력 함수의 지정
glutReshapeFunc(Resize);
glutKeyboardFunc(KeyDowninput);
glutKeyboardUpFunc(KeyUpinput);
glutMouseFunc(Mouseaction);
glutIdleFunc(Updatecallback);
}
GLvoid CRun_time_Framework::Updatecallback() {
if (myself != nullptr) {
myself->Update();
}
return GLvoid();
}
GLvoid CRun_time_Framework::Update() {
current_time = glutGet(GLUT_ELAPSED_TIME);
current_frame++;
if (current_time - Prevtime > 1000 / FPS_TIME) {
Prevtime = current_time;
current_frame = 0;
glutPostRedisplay();
}
}
CRun_time_Framework::~CRun_time_Framework() {
}
|
#include "ComputerDesktop.h"
#include "GameWindow.h"
#include "Textures.h"
#include "Button.h"
#include "App.h"
#include "App_WebBrowser.h"
ComputerDesktop::ComputerDesktop()
{
}
ComputerDesktop::ComputerDesktop(GameWindow *gameWindowP)
{
this->gameWindowP = gameWindowP;
std::cout << "GAMEWINDOW: " << this->gameWindowP << std::endl;
this->TextureGroup = &this->gameWindowP->TextureGroup;
this->desktop.setTexture(this->TextureGroup->computer_Desktop);
this->desktop.setOrigin(this->desktop.getGlobalBounds().width/2,this->desktop.getGlobalBounds().height/2);
this->desktop.setPosition(this->gameWindowP->camera_Desktop.getCenter());
this->appMenuButton = Button(this->gameWindowP,this->desktop.getGlobalBounds().left,this->desktop.getGlobalBounds().top + this->desktop.getGlobalBounds().height - this->gameWindowP->TextureGroup.TextureRects[TRAppMenuActive].height, BUTAppMenu);
this->appMenu = AppMenu(this->gameWindowP,this);
this->nextDayButton = Button(this->gameWindowP,this->desktop.getGlobalBounds().left+this->desktop.getGlobalBounds().width,this->desktop.getGlobalBounds().top + this->desktop.getGlobalBounds().height, ButNextDay);
}
sf::FloatRect ComputerDesktop::getAppButtonBounds()
{
return this->appMenuButton.getBounds();
}
void ComputerDesktop::update()
{
//std::cout << "DIALOGUELIST SIZE: " << this->dialogueList.size() << std::endl;
if(this->gameWindowP->input == InMouseRight)
std::cout << "MOUSE POS: " << this->gameWindowP->getMousePos().x << ", " << this->gameWindowP->getMousePos().y << std::endl;
this->gameWindowP->camera_Desktop.setCenter(this->desktop.getGlobalBounds().left + (this->desktop.getGlobalBounds().width/2),
this->desktop.getGlobalBounds().top + (this->desktop.getGlobalBounds().height/2));
for(unsigned i = 0; i < this->dialogueList.size(); i++)
{
this->dialogueList[i].update();
if(this->dialogueList.size() > 0)
{
if(this->dialogueList[i].setToDelete)
{
this->dialogueList.erase(this->dialogueList.begin() + i);
//this->dialogueList.clear();
break;
}
}
if(this->dialogueList.size() <= 0)
break;
this->render();
}
if(this->dialogueList.size() > 0) //RETURN FROM UPDATE TO FORCE PLAYER INTERACTION WITH DIALOGUE BOX
return;
this->checkDesktopButtonPressed();
this->appMenuButton.update();
if(this->dailyPostDone)
this->nextDayButton.update();
if(this->appMenuButton.getActive())
{
if(!this->appMenu.getActive())
this->appMenu.setActive(true);
else
this->appMenu.setActive(false);
}
if(this->nextDayButton.getActive())
{
this->gameWindowP->contMgr.ProgressToNextDay();
}
this->appMenu.update();
if(this->appMenu.tempApp != 0)
{
this->activeApp = this->appMenu.tempApp;
this->appMenu.tempApp = 0;
}
if(this->activeApp != 0)
{
if(this->activeApp->isSetToClose())
{
delete this->activeApp;
this->activeApp = 0;
}
else
{
this->activeApp->update();
this->activeApp->App::update();
}
}
this->render();
}
void ComputerDesktop::queSprites(sf::Sprite spr)
{
this->gameWindowP->queSprites(spr);
}
void ComputerDesktop::render()
{
this->queSprites(this->desktop);
if(this->activeApp != 0 && !this->activeApp->isSetToClose())
{
this->activeApp->App::render();
this->activeApp->render();
}
this->appMenuButton.render();
if(this->appMenu.getActive())
{
this->appMenu.render();
}
for(unsigned i = 0; i < this->dialogueList.size(); i++)
{
this->dialogueList[i].render();
}
if(this->dailyPostDone)
{
this->nextDayButton.render();
}
}
void ComputerDesktop::checkDesktopButtonPressed()
{
if(this->gameWindowP->input == InMouseLeft)
{
if(this->appMenuButton.getBounds().contains(this->gameWindowP->getMousePos()))
{
this->appMenuButton.Click();
}
}
}
unsigned ComputerDesktop::getDialogueListSize()
{
return this->dialogueList.size();
}
void ComputerDesktop::spawnDialogueBox(dialogueBoxType type, Website* websiteP)
{
this->dialogueList.push_back(DialogueBox(this->gameWindowP, this->TextureGroup, websiteP, 0, 0, type));
std::cout << "SPAWNED A DIALOGUE BOX" << std::endl;
}
|
// This file has been generated by Py++.
#include "boost/python.hpp"
#include "generators/include/python_CEGUI.h"
#include "TextUtils.pypp.hpp"
namespace bp = boost::python;
void register_TextUtils_class(){
{ //::CEGUI::TextUtils
typedef bp::class_< CEGUI::TextUtils, boost::noncopyable > TextUtils_exposer_t;
TextUtils_exposer_t TextUtils_exposer = TextUtils_exposer_t( "TextUtils", "*!\n\
\n\
Text utility support class. This class is all static members. You do not create instances of\
this class.\n\
*\n", bp::no_init );
bp::scope TextUtils_scope( TextUtils_exposer );
{ //::CEGUI::TextUtils::getNextWord
typedef ::CEGUI::String ( *getNextWord_function_type )( ::CEGUI::String const &,::size_t,::CEGUI::String const & );
TextUtils_exposer.def(
"getNextWord"
, getNextWord_function_type( &::CEGUI::TextUtils::getNextWord )
, ( bp::arg("str"), bp::arg("start_idx")=(::size_t)(0), bp::arg("delimiters")=CEGUI::TextUtils::DefaultWhitespace )
, "*************************************************************************\n\
Methods\n\
*************************************************************************\n\
*!\n\
\n\
return a String containing the the next word in a String.\n\
\n\
This method returns a String object containing the the word, starting at index start_idx,\
of String str\n\
as delimited by the code points specified in string delimiters (or the ends of the input\
string).\n\
\n\
@param str\n\
String object containing the input data.\n\
\n\
@param start_idx\n\
index into str where the search for the next word is to begin. Defaults to start of\
str.\n\
\n\
@param delimiters\n\
String object containing the set of delimiter code points to be used when determining the\
start and end\n\
points of a word in string str. Defaults to whitespace.\n\
\n\
@return\n\
String object containing the next delimiters delimited word from str, starting at index\
start_idx.\n\
*\n" );
}
{ //::CEGUI::TextUtils::getNextWordStartIdx
typedef ::size_t ( *getNextWordStartIdx_function_type )( ::CEGUI::String const &,::size_t );
TextUtils_exposer.def(
"getNextWordStartIdx"
, getNextWordStartIdx_function_type( &::CEGUI::TextUtils::getNextWordStartIdx )
, ( bp::arg("str"), bp::arg("idx") )
, "*!\n\
\n\
Return the index of the first character of the word after the word at idx.\n\
\n\
note\n\
This currently uses DefaultWhitespace and DefaultAlphanumerical to determine groupings for\
what constitutes a 'word'.\n\
\n\
@param str\n\
String containing text.\n\
\n\
@param idx\n\
Index into str where search is to begin.\n\
\n\
@return\n\
Index into str which marks the begining of the word at after the word at index idx.\n\
If idx is within the last word, then the return is the last index in str.\n\
*\n" );
}
{ //::CEGUI::TextUtils::getWordStartIdx
typedef ::size_t ( *getWordStartIdx_function_type )( ::CEGUI::String const &,::size_t );
TextUtils_exposer.def(
"getWordStartIdx"
, getWordStartIdx_function_type( &::CEGUI::TextUtils::getWordStartIdx )
, ( bp::arg("str"), bp::arg("idx") )
, "*!\n\
\n\
Return the index of the first character of the word at idx.\n\
\n\
note\n\
This currently uses DefaultWhitespace and DefaultAlphanumerical to determine groupings for\
what constitutes a 'word'.\n\
\n\
@param str\n\
String containing text.\n\
\n\
@param idx\n\
Index into str where search for start of word is to begin.\n\
\n\
@return\n\
Index into str which marks the begining of the word at index idx.\n\
*\n" );
}
{ //::CEGUI::TextUtils::trimLeadingChars
typedef void ( *trimLeadingChars_function_type )( ::CEGUI::String &,::CEGUI::String const & );
TextUtils_exposer.def(
"trimLeadingChars"
, trimLeadingChars_function_type( &::CEGUI::TextUtils::trimLeadingChars )
, ( bp::arg("str"), bp::arg("chars") )
, "*!\n\
\n\
Trim all characters from the set specified in chars from the begining of str.\n\
\n\
@param str\n\
String object to be trimmed.\n\
\n\
@param chars\n\
String object containing the set of code points to be trimmed.\n\
*\n" );
}
{ //::CEGUI::TextUtils::trimTrailingChars
typedef void ( *trimTrailingChars_function_type )( ::CEGUI::String &,::CEGUI::String const & );
TextUtils_exposer.def(
"trimTrailingChars"
, trimTrailingChars_function_type( &::CEGUI::TextUtils::trimTrailingChars )
, ( bp::arg("str"), bp::arg("chars") )
, "*!\n\
\n\
Trim all characters from the set specified in chars from the end of str.\n\
\n\
@param str\n\
String object to be trimmed.\n\
\n\
@param chars\n\
String object containing the set of code points to be trimmed.\n\
*\n" );
}
TextUtils_exposer.add_static_property( "DefaultAlphanumerical"
, bp::make_getter( &CEGUI::TextUtils::DefaultAlphanumerical
, bp::return_value_policy< bp::return_by_value >() ) );
TextUtils_exposer.add_static_property( "DefaultWhitespace"
, bp::make_getter( &CEGUI::TextUtils::DefaultWhitespace
, bp::return_value_policy< bp::return_by_value >() ) );
TextUtils_exposer.add_static_property( "DefaultWrapDelimiters"
, bp::make_getter( &CEGUI::TextUtils::DefaultWrapDelimiters
, bp::return_value_policy< bp::return_by_value >() ) );
TextUtils_exposer.staticmethod( "getNextWord" );
TextUtils_exposer.staticmethod( "getNextWordStartIdx" );
TextUtils_exposer.staticmethod( "getWordStartIdx" );
TextUtils_exposer.staticmethod( "trimLeadingChars" );
TextUtils_exposer.staticmethod( "trimTrailingChars" );
}
}
|
/***********************************************************************
* Copyright (C) 2019 Yinheyi. <chinayinheyi@163.com>
*
* 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.
* Brief:
* Author: yinheyi
* Email: chinayinheyi@163.com
* Version: 1.0
* Created Time: 2019年06月08日 星期六 10时03分26秒
* Modifed Time: 2019年06月09日 星期日 23时13分25秒
* Blog: http://www.cnblogs.com/yinheyi
* Github: https://github.com/yinheyi
*
***********************************************************************/
typedef unsigned long int size_t;
// 定义一个枚举类型,表示红黑树的颜色
enum RBColor
{
RED,
BLACK,
};
// 红黑树结点的定义
struct RBNode
{
RBNode();
int m_nValue;
int m_nColor;
RBNode* m_pParent;
RBNode* m_pLeft;
RBNode* m_pRight;
};
// 红黑树类的定义
class RBTree
{
public:
RBTree();
~RBTree();
RBNode* search(int nValue_) const;
bool insert(int nValue_);
bool erase(RBNode* pNode_);
size_t size() const;
bool empty() const;
int min() const;
int max() const;
protected:
void transplant(RBNode* pOldNode_, RBNode* pNewNode_); // 以新树代替旧树
RBNode* precursor(RBNode* pNode_)const ; // 求前驱结点
RBNode* successor(RBNode* pNode_) const; // 求后驱结点
RBNode* min_node(RBNode* pNode_) const; // 查找给定子树中最小结点的指针
RBNode* max_node(RBNode* pNode_) const; // 查找给定子树中最大结点的指针
void left_rotate(RBNode* pNode_); // 左旋操作
void right_rotate(RBNode* pNode_); // 右旋操作
void insert_fixup(RBNode* pNode_); // 插入之后调整红黑树,使其符合红黑树的性质
void erase_fixup(RBNode* pNode_, RBNode* pParent_); // 删除之后调整红黑树,使其符合红黑树的性质
RBNode* sibling(RBNode* pNode_) const; // 获取给定结点的兄弟结点
void free_memory(RBNode* pNode); // 释放给定红黑树的内存空间
private:
size_t m_nSize;
RBNode* m_pRoot;
};
|
#ifndef SRC_PT_PTOROP_H
#define SRC_PT_PTOROP_H
/// @file src/pt/PtOrOp.h
/// @brief PtOrOp のヘッダファイル
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2005-2011 Yusuke Matsunaga
/// All rights reserved.
#include "PtBinaryOp.h"
BEGIN_NAMESPACE_YM_BB
//////////////////////////////////////////////////////////////////////
/// @class PtOrOp PtOrOp.h "PtOrOp.h"
/// @brief 加算を表すノード
//////////////////////////////////////////////////////////////////////
class PtOrOp :
public PtBinaryOp
{
public:
/// @brief コンストラクタ
/// @param[in] file_region ファイル上の位置
/// @param[in] opr1, opr2 オペランド
PtOrOp(const FileRegion& file_region,
PtNode* opr1,
PtNode* opr2);
/// @brief デストラクタ
virtual
~PtOrOp();
public:
//////////////////////////////////////////////////////////////////////
// PtNode の仮想関数
//////////////////////////////////////////////////////////////////////
/// @brief 型を返す.
virtual
tType
type() const;
/// @brief 内容を表す文字列を返す.
virtual
string
decompile() const;
/// @brief 対応した AIG を作る.
virtual
void
gen_aig(AigMgr& aigmgr,
const vector<Aig>& bvar_array,
ymuint bw,
vector<Aig>& out_array);
};
END_NAMESPACE_YM_BB
#endif // SRC_PT_PTOROP_H
|
#include <map>
#include <set>
#include <utility>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#define pir std::pair<int , int>
#define mp(x , y) std::make_pair(x , y)
#define DEBUG printf("Passing [%s] in Line %d\n" , __FUNCTION__ , __LINE__) ;
const int MAX_N = 3e5 + 10 , dx[4] = {-1 , 1 , 0 , 0} , dy[4] = {0 , 0 , 1 , -1} ;
char s[MAX_N] ;
pir ans[MAX_N] ;
int n , m , a[MAX_N] ;
std::map<pir , std::set<int> > mp ;
int trans(char c) {
if (c == 'L') return 0 ;
else if (c == 'R') return 1 ;
else if (c == 'U') return 2 ;
else return 3 ;
}
inline pir work(pir a , int ty) {
return mp(a.first + dx[ty] , a.second + dy[ty]) ;
}
void merge(pir a , pir b) {
if (mp[b].size() > mp[a].size()) mp[a].swap(mp[b]) ;
for (std::set<int>::iterator p = mp[b].begin() ; p != mp[b].end() ; ++p) mp[a].insert(*p) ;
mp[b].clear() ;
}
int main() {
scanf("%d%s" , &n , s) ;
for (int i = 0 ; i < n ; ++i) a[i] = trans(s[i]) ^ 1 ;
scanf("%d" , &m) ;
for (int i = 0 ; i < m ; ++i) {
int x , y ;
scanf("%d %d" , &x , &y) ;
mp[mp(x , y)].insert(i) ;
}
///
pir nw = mp(0 , 0) ;
for (int i = 0 ; i < n ; ++i) {
pir np = work(nw , a[i]) , nnp = work(np , a[i]) ;
if (mp.count(np) && !mp[np].empty()) merge(nnp , np) ;
nw = np ;
}
for (std::map<pir , std::set<int> >::iterator p = mp.begin() ; p != mp.end() ; ++p)
for (std::set<int>::iterator q = p->second.begin() ; q != p->second.end() ; ++q)
ans[*q] = mp(p->first.first - nw.first , p->first.second - nw.second) ;
for (int i = 0 ; i < m ; ++i) printf("%d %d\n" , ans[i].first , ans[i].second) ;
return 0 ;
}
|
// OnHScrollLineLeft.h
#ifndef _ONHSCROLLLINELEFT_H
#define _ONHSCROLLLINELEFT_H
#include "ScrollAction.h"
#include "HorizontalScroll.h"
class OnHScrollLineLeft : public ScrollAction {
public:
OnHScrollLineLeft(HorizontalScroll *horizontalScroll);
OnHScrollLineLeft(const OnHScrollLineLeft& source);
virtual ~OnHScrollLineLeft();
OnHScrollLineLeft& operator=(const OnHScrollLineLeft& source);
virtual void Action(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
private:
HorizontalScroll *horizontalScroll;
};
#endif //_ONHSCROLLLINELEFT_H
|
#ifndef PNODE_MAP_H
#define PNODE_MAP_H
#include <vector>
#include <iostream>
#include "PNode.h"
class PNode_Map{
public:
void Build_Map(const vector<vector<int>>& array);
void Clear_Map();
PNode* Start_node;
PNode* End_node;
private:
vector<vector<PNode*>> pnode;
};
#endif
|
#include <MetaEvent.h>
#include <EventID.h>
#include <memory>
using namespace std;
MetaEvent::iterator::iterator(Storage::iterator iter)
: Storage::iterator(iter) {}
MetaAttribute& MetaEvent::iterator::operator*() {
return this->Storage::iterator::operator*().second;
}
MetaEvent::const_iterator::const_iterator(Storage::const_iterator iter)
: Storage::const_iterator(iter) {}
const MetaAttribute& MetaEvent::const_iterator::operator*() const {
return this->Storage::const_iterator::operator*().second;
}
const MetaAttribute* MetaEvent::attribute(id::attribute::ID id) const {
Storage::const_iterator iter = mStorage.find(id);
if(iter != mStorage.end())
return &(iter->second);
else
return nullptr;
}
MetaAttribute* MetaEvent::attribute(id::attribute::ID id){
Storage::iterator iter = mStorage.find(id);
if(iter != mStorage.end())
return &(iter->second);
else
return nullptr;
}
MetaEvent::MetaEvent(const EventType& eT) {
for(const AttributeType& aT: eT)
add(MetaAttribute(aT));
}
MetaEvent& MetaEvent::operator=(const MetaEvent& copy) {
if(mStorage.size()==0) {
mStorage = copy.mStorage;
return *this;
}
for(Storage::value_type& v : mStorage) {
Storage::const_iterator it = copy.mStorage.find(v.first);
if(it!=copy.mStorage.end())
v.second = it->second;
}
return *this;
}
bool MetaEvent::add(const MetaAttribute& mA) {
auto res = mStorage.emplace(mA.id(), mA.id());
if(res.second) {
res.first->second = mA;
return true;
} else
return false;
}
bool MetaEvent::add(MetaAttribute&& mA) {
auto res = mStorage.emplace(mA.id(), mA.id());
if(res.second) {
res.first->second = move(mA);
return true;
} else
return false;
}
bool MetaEvent::operator==(const MetaEvent& b) const {
if(mStorage.size() != b.mStorage.size())
return false;
for(const MetaAttribute& mA : *this) {
const MetaAttribute* bPtr = b.attribute(mA.id());
if(! bPtr || mA != *bPtr)
return false;
}
return true;
}
bool MetaEvent::compatible(const MetaEvent& b) const {
return EventID(*this) <= EventID(b);
}
bool MetaEvent::valid() const {
bool valid = true;
for(const MetaAttribute& a: *this)
valid &= a.valid();
return valid;
}
MetaEvent& MetaEvent::operator+=(const MetaEvent& b) {
if(!compatible(b))
mStorage.clear();
else
for(MetaAttribute& a: *this)
a+=b[a.id()];
return *this;
}
MetaEvent& MetaEvent::operator-=(const MetaEvent& b) {
if(!compatible(b))
mStorage.clear();
else
for(MetaAttribute& a: *this)
a-=b[a.id()];
return *this;
}
MetaEvent& MetaEvent::operator*=(const MetaValue& b) {
for(MetaAttribute& a: *this)
a.value()*=b;
return *this;
}
MetaEvent& MetaEvent::operator/=(const MetaValue& b) {
for(MetaAttribute& a: *this)
a.value()/=b;
return *this;
}
MetaEvent operator*(const MetaValue& a, const MetaEvent& b) {
MetaEvent temp(b);
for(MetaAttribute& attr: temp)
attr=a*attr;
return temp;
}
MetaEvent::operator EventType() const {
EventType eT;
for(const MetaAttribute& a : *this)
eT.add( (AttributeType)a );
return eT;
}
MetaEvent::iterator MetaEvent::begin() noexcept {
return iterator(mStorage.begin());
}
MetaEvent::const_iterator MetaEvent::begin() const noexcept {
return const_iterator(mStorage.begin());
}
MetaEvent::iterator MetaEvent::end() noexcept {
return iterator(mStorage.end());
}
MetaEvent::const_iterator MetaEvent::end() const noexcept {
return const_iterator(mStorage.end());
}
ostream& operator<<(ostream& o, const MetaEvent& me) {
o << "Event: " << endl;
for(const MetaAttribute& ma : me)
o << "\t" << ma << endl;
return o;
}
|
//
// Created by 79164 on 18.11.2020.
//
#ifndef UDP_SERVER_INTERACTION_H
#define UDP_SERVER_INTERACTION_H
#include <stddef.h>
#include <stdint.h>
#include <iterator>
#include <iostream>
#include <fstream>
#include <vector>
#include <array>
#define POLY 0x82f63b78
#define ACK 0
#define PUT 1
#define MAX_DATA_SIZE 23//1472
#define PACKAGE_SIZE (MAX_DATA_SIZE + 17)
#define ID_SIZE 8
typedef unsigned char byte;
namespace udp_server {
class DataProcessor {
private:
struct data_node{
uint32_t seq_number;
std::array<byte, MAX_DATA_SIZE> data;
};
public:
#pragma pack(1)
struct data_from_client {
uint32_t seq_number;
uint32_t seq_total;
uint8_t type;
byte id[ID_SIZE];
byte data[MAX_DATA_SIZE];
};
#pragma pack(pop)
struct data_to_file_system{
std::vector<byte> data;
std::array<byte, ID_SIZE> name;
};
data_to_file_system File;
//struct data_from_client package{};
int m_crc;
int m_num_full_file;
bool m_ready_file;
bool check_data_id();
bool check_data_type(data_from_client package);
void delete_file(int num_file);
int check_full_file(int number_file);
DataProcessor::data_from_client request_package(DataProcessor::data_from_client package,
uint32_t quantity_package, uint32_t crc);
class PackageVector{
private:
//std::vector<data_node> package;
public:
//PackageVector(data_node package_data, uint32_t seq_number);
PackageVector(uint32_t seq_total, uint32_t seq_number, std::array<byte, MAX_DATA_SIZE> package_data);
~PackageVector();
std::vector<std::array<byte, MAX_DATA_SIZE>> package;
bool push_in(std::array<byte, MAX_DATA_SIZE> package_data, uint32_t seq_number);
std::array<byte, MAX_DATA_SIZE> get_package(uint32_t seq_number);
};
/*class PackageList {
public:
std::list<data_node> node;
explicit PackageList(data_node package_data);
~PackageList();
char *push_in_list(data_node package_data);
char *pop_from_list(data_node package_data);
char *sort_package_list();
void parce_packege(data_node &package_data);
static bool my_compare(DataProcessor::data_from_client, const data_node &node2);
};*/
private:
struct data_properties{
uint32_t quantity_package;
uint32_t seq_total;
std::array<byte, 8> file_id;
PackageVector *Origin;
};
std::vector<data_properties> rfiles;
std::vector<byte> concantenate_packages(data_properties, std::vector<byte> concantenated_data);
public:
DataProcessor();
~DataProcessor();
DataProcessor::data_from_client presence_file(data_from_client package);
bool readiness_file();
bool write_file();
class FileSystem {
public:
FileSystem(std::array<byte, 8> file_name, std::vector<byte> data);
~FileSystem();
int save_package(byte *data);
static uint32_t crc32c(uint32_t crc, const char *buf, size_t len);
bool check_crc32c(uint32_t crc_input_file, uint32_t crc_output_file);
private:
std::ofstream file;
};
};
}
#endif //UDP_SERVER_INTERACTION_H
|
// Time is sort(O(nlogn + n))
// Space is O(n+n)=>O(2*n)
class Solution
{
public:
//Function to find the minimum number of swaps required to sort the array.
int minSwaps(vector<int>&nums)
{
vector<int> temp=nums;
int n = nums.size();
unordered_map<int,int> hash;
for(int i=0;i<n;i++)
{
hash[nums[i]]=i;
}
sort(temp.begin(),temp.end());
int count =0;
for(int i=0;i<n;i++)
{
if(temp[i]==nums[i])
{
continue;
}
int index = hash[temp[i]];
if(index!=i)
count+=1;
swap(nums[i],nums[index]);
hash[nums[i]]=i;
hash[nums[index]]=index;
}
return count;
}
};
|
#include "PostSearchAnalysisTask.h"
#include "PostSearchAnalysisParameters.h"
#include "../../EngineLayer/ProteinParsimony/ProteinGroup.h"
#include "../../EngineLayer/PeptideSpectralMatch.h"
#include "../MyTaskResults.h"
#include "../../EngineLayer/GlobalVariables.h"
#include "../../EngineLayer/EventArgs/ProgressEventArgs.h"
#include "../DbForTask.h"
#include "../FileSpecificParameters.h"
#include "../../EngineLayer/CommonParameters.h"
#include "../../EngineLayer/ProteinParsimony/ProteinParsimonyEngine.h"
#include "../../EngineLayer/ProteinParsimony/ProteinParsimonyResults.h"
#include "../../EngineLayer/ProteinScoringAndFdr/ProteinScoringAndFdrEngine.h"
#include "../../EngineLayer/ProteinScoringAndFdr/ProteinScoringAndFdrResults.h"
#include "../../EngineLayer/MetaMorpheusException.h"
#include "../../EngineLayer/FdrAnalysis/FdrAnalysisEngine.h"
#include "../../EngineLayer/ModificationAnalysis/ModificationAnalysisEngine.h"
#include "MzIdentMLWriter.h"
#include "../PepXMLWriter.h"
#include <fstream>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <unordered_map>
#include <experimental/filesystem>
#include "Group.h"
#include "MzLibMath.h"
using namespace EngineLayer;
using namespace EngineLayer::FdrAnalysis;
using namespace EngineLayer::HistogramAnalysis;
using namespace EngineLayer::Localization;
using namespace EngineLayer::ModificationAnalysis;
using namespace FlashLFQ;
using namespace MassSpectrometry;
//using namespace MathNet::Numerics::Distributions;
using namespace Proteomics;
using namespace Proteomics::ProteolyticDigestion;
using namespace UsefulProteomicsDatabases;
namespace TaskLayer
{
PostSearchAnalysisParameters *PostSearchAnalysisTask::getParameters() const
{
return privateParameters;
}
void PostSearchAnalysisTask::setParameters(PostSearchAnalysisParameters *value)
{
privateParameters = value;
}
std::vector<EngineLayer::ProteinGroup*> PostSearchAnalysisTask::getProteinGroups() const
{
return privateProteinGroups;
}
void PostSearchAnalysisTask::setProteinGroups(const std::vector<EngineLayer::ProteinGroup*> &value)
{
privateProteinGroups = value;
}
std::vector<std::pair<std::string, std::vector<PeptideSpectralMatch*>>>& PostSearchAnalysisTask::getPsmsGroupedByFile()
{
return privatePsmsGroupedByFile;
}
void PostSearchAnalysisTask::setPsmsGroupedByFile(const std::vector<std::pair<std::string, std::vector<PeptideSpectralMatch*>>> &value) {
privatePsmsGroupedByFile = value;
}
PostSearchAnalysisTask::PostSearchAnalysisTask() : MetaMorpheusTask(MyTask::Search)
{
}
MyTaskResults *PostSearchAnalysisTask::Run()
{
if ( getParameters()->getSearchParameters()->getMassDiffAcceptorType() == MassDiffAcceptorType::ModOpen ||
getParameters()->getSearchParameters()->getMassDiffAcceptorType() == MassDiffAcceptorType::Open ||
getParameters()->getSearchParameters()->getMassDiffAcceptorType() == MassDiffAcceptorType::Custom)
{
// This only makes sense if there is a mass difference that you want to localize.
//No use for exact and missed monoisotopic mass searches.
getParameters()->getSearchParameters()->setDoLocalizationAnalysis(true);
}
else
{
getParameters()->getSearchParameters()->setDoLocalizationAnalysis(false);
}
//update all psms with peptide info
//if it hasn't been done already
if (getParameters()->getSearchParameters()->getSearchType() != SearchType::NonSpecific)
{
std::vector<PeptideSpectralMatch*> tmppsms;
for ( auto psm: getParameters()->getAllPsms() ){
if ( psm != nullptr ) {
tmppsms.push_back(psm);
}
}
getParameters()->setAllPsms(tmppsms);
for (auto psm : tmppsms ) {
psm->ResolveAllAmbiguities();
}
#ifdef ORIG
getParameters()->setAllPsms(getParameters()->getAllPsms().OrderByDescending([&] (std::any b) {
b::Score;
}).ThenBy([&] (std::any b) {
b::PeptideMonisotopicMass.HasValue ? std::abs(b::ScanPrecursorMass - b::PeptideMonisotopicMass->Value) : std::numeric_limits<double>::max();
}).GroupBy([&] (std::any b) {
(b::FullFilePath, b::ScanNumber, b::PeptideMonisotopicMass);
})->Select([&] (std::any b) {
b::front();
}).ToList());
#endif
//
std::sort(tmppsms.begin(), tmppsms.end(), [&] (PeptideSpectralMatch *r, PeptideSpectralMatch *l) {
if ( r->getScore() > l->getScore() ) return true;
if ( r->getScore() < l->getScore() ) return false;
double lval= std::numeric_limits<double>::max(), rval=std::numeric_limits<double>::max();
if ( l->getPeptideMonisotopicMass().has_value() ) {
lval = std::abs(l->getScanPrecursorMass() - l->getPeptideMonisotopicMass().value());
}
if ( r->getPeptideMonisotopicMass().has_value() ) {
rval = std::abs(r->getScanPrecursorMass() - r->getPeptideMonisotopicMass().value());
}
return rval < lval;
});
//GroupBy tuple
std::vector<std::vector<PeptideSpectralMatch *>>tvec;
for ( auto psm : tmppsms ) {
bool found = false;
for ( auto t : tvec ) {
if ( t[0]->getFullFilePath() == psm->getFullFilePath() &&
t[0]->getScanNumber() == psm->getScanNumber() &&
t[0]->getPeptideMonisotopicMass() == psm->getPeptideMonisotopicMass() ) {
t.push_back(psm);
found = true;
break;
}
}
if ( !found ) {
std::vector<PeptideSpectralMatch *> *t = new std::vector<PeptideSpectralMatch *>;
t->push_back(psm);
tvec.push_back(*t);
}
}
// Select first
std::vector<PeptideSpectralMatch*> scoreSorted;
for ( auto t: tvec ) {
scoreSorted.push_back(t[0]);
}
getParameters()->setAllPsms(scoreSorted);
CalculatePsmFdr();
}
DoMassDifferenceLocalizationAnalysis();
ProteinAnalysis();
QuantificationAnalysis();
std::vector<std::string> svec;
svec.push_back(getParameters()->getSearchTaskId());
svec.push_back("Individual Spectra Files");
ProgressEventArgs tempVar(100, "Done!", svec);
ReportProgress(&tempVar, getVerbose());
HistogramAnalysis();
WritePsmResults();
WriteProteinResults();
WriteQuantificationResults();
WritePrunedDatabase();
return getParameters()->getSearchTaskResults();
}
MyTaskResults *PostSearchAnalysisTask::RunSpecific(const std::string &OutputFolder,
std::vector<DbForTask*> &dbFilenameList,
std::vector<std::string> ¤tRawFileList,
const std::string &taskId,
std::vector<FileSpecificParameters*> &fileSettingsList)
{
return nullptr;
}
void PostSearchAnalysisTask::CalculatePsmFdr()
{
// TODO: because FDR is done before parsimony, if a PSM matches to a target and a decoy protein,
// there may be conflicts between how it's handled in parsimony and the FDR engine here
// for example, here it may be treated as a decoy PSM, where as in parsimony it will be determined
// by the parsimony algorithm which is agnostic of target/decoy assignments
// this could cause weird PSM FDR issues
Status("Estimating PSM FDR...", getParameters()->getSearchTaskId(), getVerbose());
int massDiffAcceptorNumNotches = getParameters()->getNumNotches();
std::vector<std::string> svec;
svec.push_back(getParameters()->getSearchTaskId());
auto tmppsms = getParameters()->getAllPsms();
auto tempVar = new FdrAnalysisEngine ( tmppsms, massDiffAcceptorNumNotches, getCommonParameters(), svec, getVerbose());
tempVar->Run();
// sort by q-value because of group FDR stuff
// e.g. multiprotease FDR, non/semi-specific protease, etc
#ifdef ORIG
getParameters()->setAllPsms(getParameters()->getAllPsms().OrderBy([&] (std::any p) {
p::FdrInfo::QValue;
}).ThenByDescending([&] (std::any p) {
p::Score;
}).ThenBy([&] (std::any p) {
p::FdrInfo::CumulativeTarget;
}).ToList());
#endif
tmppsms.clear();
tmppsms = getParameters()->getAllPsms();
std::sort(tmppsms.begin(), tmppsms.end(), [&] (PeptideSpectralMatch *r, PeptideSpectralMatch *l) {
if ( r->getFdrInfo()->getQValue() < l->getFdrInfo()->getQValue() ) return true;
if ( r->getFdrInfo()->getQValue() > l->getFdrInfo()->getQValue() ) return false;
if ( r->getScore() > l->getScore() ) return true;
if ( r->getScore() < l->getScore() ) return false;
if ( r->getFdrInfo()->getCumulativeTarget() < l->getFdrInfo()->getCumulativeTarget() ) return true;
return false;
});
getParameters()->setAllPsms(tmppsms);
Status("Done estimating PSM FDR!", getParameters()->getSearchTaskId(), getVerbose());
}
void PostSearchAnalysisTask::ProteinAnalysis()
{
if (!getParameters()->getSearchParameters()->getDoParsimony())
{
return;
}
Status("Constructing protein groups...", getParameters()->getSearchTaskId(), getVerbose());
// run parsimony
auto tmppsms = getParameters()->getAllPsms();
std::vector<std::string> svec = {getParameters()->getSearchTaskId()};
auto tempVar = new ProteinParsimonyEngine (tmppsms, getParameters()->getSearchParameters()->getModPeptidesAreDifferent(),
getCommonParameters(), svec, getVerbose() );
ProteinParsimonyResults *proteinAnalysisResults = static_cast<ProteinParsimonyResults*>(tempVar->Run());
// score protein groups and calculate FDR
auto tmp = proteinAnalysisResults->getProteinGroups();
tmppsms = getParameters()->getAllPsms();
auto tempVar2 = new ProteinScoringAndFdrEngine (tmp, tmppsms,
getParameters()->getSearchParameters()->getNoOneHitWonders(),
getParameters()->getSearchParameters()->getModPeptidesAreDifferent(),
true, getCommonParameters(), svec, getVerbose() );
ProteinScoringAndFdrResults *proteinScoringAndFdrResults = static_cast<ProteinScoringAndFdrResults*>(tempVar2->Run());
setProteinGroups(proteinScoringAndFdrResults->SortedAndScoredProteinGroups);
for (auto psm : getParameters()->getAllPsms())
{
psm->ResolveAllAmbiguities();
}
Status("Done constructing protein groups!", getParameters()->getSearchTaskId(), getVerbose());
}
void PostSearchAnalysisTask::DoMassDifferenceLocalizationAnalysis()
{
if (getParameters()->getSearchParameters()->getDoLocalizationAnalysis())
{
Status("Running mass-difference localization analysis...", getParameters()->getSearchTaskId(), getVerbose());
for (int spectraFileIndex = 0; spectraFileIndex < (int)getParameters()->getCurrentRawFileList().size();
spectraFileIndex++)
{
EngineLayer::CommonParameters *combinedParams = SetAllFileSpecificCommonParams(getCommonParameters(),
getParameters()->getFileSettingsList()[spectraFileIndex]);
auto origDataFile = getParameters()->getCurrentRawFileList()[spectraFileIndex];
std::vector<std::string> svec = {getParameters()->getSearchTaskId(), "Individual Spectra Files",
origDataFile};
Status("Running mass-difference localization analysis...", svec, getVerbose());
MsDataFile *myMsDataFile = getParameters()->getMyFileManager()->LoadFile(origDataFile,
std::make_optional(combinedParams->getTopNpeaks()),
std::make_optional(combinedParams->getMinRatio()),
combinedParams->getTrimMs1Peaks(),
combinedParams->getTrimMsMsPeaks(), combinedParams);
std::vector<std::string> svec2 = {getParameters()->getSearchTaskId(), "Individual Spectra Files",
origDataFile};
std::vector<PeptideSpectralMatch*> tmppsms;
for ( auto b : getParameters()->getAllPsms() ) {
if ( b->getFullFilePath() == origDataFile ) {
tmppsms.push_back(b);
}
}
auto tempVar = new LocalizationEngine (tmppsms, myMsDataFile, combinedParams, svec2, getVerbose());
tempVar->Run();
getParameters()->getMyFileManager()->DoneWithFile(origDataFile);
std::vector<std::string> svec3 = {getParameters()->getSearchTaskId(), "Individual Spectra Files",
origDataFile};
ProgressEventArgs tempVar2(100, "Done with localization analysis!", svec3);
ReportProgress(&tempVar2, getVerbose());
}
}
// count different modifications observed
auto tmppsms2 = getParameters()->getAllPsms();
std::vector<std::string> svec4 = {getParameters()->getSearchTaskId()};
auto tempVar3 = new ModificationAnalysisEngine(tmppsms2, getCommonParameters(), svec4, getVerbose());
tempVar3->Run();
}
void PostSearchAnalysisTask::QuantificationAnalysis()
{
if (!getParameters()->getSearchParameters()->getDoQuantification())
{
return;
}
// pass quantification parameters to FlashLFQ
Status("Quantifying...", getParameters()->getSearchTaskId(), getVerbose());
// construct file info for FlashLFQ
std::vector<SpectraFileInfo*> spectraFileInfo;
// get experimental design info for normalization
if (getParameters()->getSearchParameters()->getNormalize())
{
std::experimental::filesystem::path Path = getParameters()->getCurrentRawFileList().front();//.FullName;
std::string assumedExperimentalDesignPath = Path.parent_path();
assumedExperimentalDesignPath = assumedExperimentalDesignPath +"/" +
GlobalVariables::getExperimentalDesignFileName();
if (std::experimental::filesystem::exists(assumedExperimentalDesignPath))
{
std::unordered_map<std::string, std::string> experimentalDesign;
char delimiter = '\t';
std::ifstream input(assumedExperimentalDesignPath);
if ( input.is_open() ) {
std::string line;
while ( getline( input, line) ) {
auto svec = StringHelper::split(line, delimiter);
for ( auto s: svec ) {
experimentalDesign.emplace(s, line);
}
}
}
else {
std::cout << "Could not open file " << assumedExperimentalDesignPath << std::endl;
}
input.close();
for (auto file : getParameters()->getCurrentRawFileList())
{
//std::string filename = Path::GetFileNameWithoutExtension(file);
std::string filename = file.substr(0, file.find_last_of("."));
auto expDesignForThisFile = experimentalDesign[filename];
char delimiter = '\t';
auto split = StringHelper::split(expDesignForThisFile, delimiter);
std::string condition = split[1];
int biorep = std::stoi(split[2]);
int fraction = std::stoi(split[3]);
int techrep = std::stoi(split[4]);
// experimental design info passed in here for each spectra file
auto tempVar = new SpectraFileInfo( file, condition, biorep - 1, techrep - 1, fraction - 1 );
spectraFileInfo.push_back(tempVar);
getParameters()->getMyFileManager()->DoneWithFile(file);
}
}
else
{
throw MetaMorpheusException("Could not find experimental design file at location:\n" +
assumedExperimentalDesignPath);
}
}
else
{
for (auto file : getParameters()->getCurrentRawFileList())
{
// experimental design info passed in here for each spectra file
auto tempVar2 = new SpectraFileInfo(file, "", 0, 0, 0);
spectraFileInfo.push_back(tempVar2);
getParameters()->getMyFileManager()->DoneWithFile(file);
}
}
// get PSMs to pass to FlashLFQ
#ifdef ORIG
auto unambiguousPsmsBelowOnePercentFdr = getParameters()->getAllPsms().Where([&] (std::any p) {
return p::FdrInfo::QValue <= 0.01 && p::FdrInfo::QValueNotch <= 0.01 &&
!p::IsDecoy && p::FullSequence != nullptr;
}).ToList();
#endif
std::vector<PeptideSpectralMatch*> unambiguousPsmsBelowOnePercentFdr;
for ( auto p : getParameters()->getAllPsms() ) {
if ( p->getFdrInfo()->getQValue() <= 0.01 &&
p->getFdrInfo()->getQValueNotch() <= 0.01 &&
!p->getIsDecoy() &&
p->getFullSequence().length() != 0 ) {
unambiguousPsmsBelowOnePercentFdr.push_back(p);
}
}
#ifdef ORIG
auto psmsGroupedByFile = unambiguousPsmsBelowOnePercentFdr.GroupBy([&] (std::any p) {
p::FullFilePath;
});
#endif
std::function<bool(PeptideSpectralMatch*,PeptideSpectralMatch*)> f1 = [&]
(PeptideSpectralMatch *l, PeptideSpectralMatch *r) {
return l->getFullFilePath() < r->getFullFilePath(); } ;
std::function<bool(PeptideSpectralMatch*,PeptideSpectralMatch*)> f2 = [&]
(PeptideSpectralMatch *l, PeptideSpectralMatch *r) {
return l->getFullFilePath() != r->getFullFilePath(); } ;
std::vector<std::vector<PeptideSpectralMatch*>> psmsGroupedByFile = Group::GroupBy ( unambiguousPsmsBelowOnePercentFdr, f1, f2);
// pass protein group info for each PSM
std::unordered_map<PeptideSpectralMatch*, std::vector<FlashLFQ::ProteinGroup*>> psmToProteinGroups;
if (getProteinGroups().size() > 0)
{
for (auto proteinGroup : getProteinGroups())
{
std::vector<Protein*> proteinsOrderedByAccession(proteinGroup->getProteins().begin(), proteinGroup->getProteins().end());
std::sort( proteinsOrderedByAccession.begin(), proteinsOrderedByAccession.end(), [&] (Protein *l, Protein *r) {
return l->getAccession() < r->getAccession();
});
#ifdef ORIG
auto flashLfqProteinGroup = new FlashLFQ::ProteinGroup(proteinGroup->getProteinGroupName(),
std::string::Join("|", proteinsOrderedByAccession->Select([&] (std::any p) {
p::GeneNames->Select([&] (std::any x) {
x::Item2;
}).FirstOrDefault();
})), std::string::Join("|", proteinsOrderedByAccession->Select([&] (std::any p){
p::Organism;
}).Distinct()));
#endif
std::string del = "|";
std::vector<std::string> svec1, svec2;
for ( auto p: proteinsOrderedByAccession ) {
if ( p->getGeneNames().size() > 0 ) {
svec1.push_back(std::get<1>(p->getGeneNames().front()) );
bool found = false;
for ( auto q: svec2 ) {
if ( q == p->getOrganism() ) {
found = true;
break;
}
}
if (!found ) {
svec2.push_back(p->getOrganism() );
}
}
}
std::string s1 = StringHelper::join (svec1, del);
std::string s2 = StringHelper::join (svec2, del);
auto flashLfqProteinGroup = new FlashLFQ::ProteinGroup(proteinGroup->getProteinGroupName(),
s1, s2 );
for (auto psm : proteinGroup->getAllPsmsBelowOnePercentFDR() )
{
if ( psm->getFullSequence().length() == 0 ) {
continue;
}
std::unordered_map<PeptideSpectralMatch*, std::vector<FlashLFQ::ProteinGroup*>>::const_iterator psmToProteinGroups_iterator = psmToProteinGroups.find(psm);
if (psmToProteinGroups_iterator != psmToProteinGroups.end())
{
psmToProteinGroups[psm].push_back(flashLfqProteinGroup);
}
else
{
std::vector<FlashLFQ::ProteinGroup*> svec1 = {flashLfqProteinGroup};
psmToProteinGroups.emplace(psm, svec1);
}
}
//C# TO C++ CONVERTER TODO TASK: A 'delete flashLfqProteinGroup' statement was not added since
//flashLfqProteinGroup was passed to a method or constructor. Handle memory management manually.
}
}
else
{
// if protein groups were not constructed, just use accession numbers
std::unordered_map<std::string, FlashLFQ::ProteinGroup*> accessionToPg;
for (auto psm : unambiguousPsmsBelowOnePercentFdr)
{
std::vector<Protein*> proteins;
for ( auto b: psm->getBestMatchingPeptides() ) {
bool found = false;
for ( auto q: proteins ) {
if ( q->Equals(std::get<1>(b)->getProtein()) ) {
found = true;
break;
}
}
if ( !found ) {
proteins.push_back(std::get<1>(b)->getProtein() );
}
}
for (auto protein : proteins)
{
if (accessionToPg.find(protein->getAccession()) == accessionToPg.end())
{
std::vector<std::string> svec;
for ( auto p: protein->getGeneNames() ) {
bool found = false;
std::string tmps = std::get<1>(p);
for ( auto q: svec ) {
if ( tmps == q ) {
found = true;
break;
}
}
if ( !found ) {
svec.push_back(tmps);
}
}
std::string del = "|";
std::string s = StringHelper::join(svec, del );
FlashLFQ::ProteinGroup tempVar3(protein->getAccession(), s, protein->getOrganism());
accessionToPg.emplace(protein->getAccession(), &tempVar3);
}
std::unordered_map<PeptideSpectralMatch*, std::vector<FlashLFQ::ProteinGroup*>>::const_iterator psmToProteinGroups_iterator = psmToProteinGroups.find(psm);
if (psmToProteinGroups_iterator != psmToProteinGroups.end())
{
psmToProteinGroups[psm].push_back(accessionToPg[protein->getAccession()]);
}
else
{
std::vector<FlashLFQ::ProteinGroup*>vpg = {accessionToPg[protein->getAccession()]};
psmToProteinGroups.emplace(psm, vpg );
}
}
}
}
// some PSMs may not have protein groups (if 2 peptides are required to construct a protein group,
// some PSMs will be left over)
// the peptides should still be quantified but not considered for protein quantification
auto undefinedPg = new FlashLFQ::ProteinGroup("UNDEFINED", "", "");
//sort the unambiguous psms by protease to make MBR compatible with multiple proteases
std::unordered_map<Protease*, std::vector<PeptideSpectralMatch*>> proteaseSortedPsms;
std::unordered_map<Protease*, FlashLfqResults*> proteaseSortedFlashLFQResults;
for (auto dp : getParameters()->getListOfDigestionParams())
{
if (proteaseSortedPsms.find(dp->getProtease()) == proteaseSortedPsms.end())
{
proteaseSortedPsms.emplace(dp->getProtease(), std::vector<PeptideSpectralMatch*>());
}
}
for (auto psm : unambiguousPsmsBelowOnePercentFdr)
{
if (psmToProteinGroups.find(psm) == psmToProteinGroups.end())
{
psmToProteinGroups.emplace(psm, std::vector<FlashLFQ::ProteinGroup*> {undefinedPg});
}
proteaseSortedPsms[psm->digestionParams->getProtease()].push_back(psm);
}
// pass PSM info to FlashLFQ
auto flashLFQIdentifications = std::vector<Identification*>();
for (auto spectraFile : psmsGroupedByFile)
{
SpectraFileInfo* rawfileinfo;
for ( auto p: spectraFileInfo ) {
if ( p->FullFilePathWithExtension == spectraFile[0]->getFullFilePath() ) {
rawfileinfo = p;
break;
}
}
for (auto psm : spectraFile)
{
auto tempVar4 = new Identification (rawfileinfo, psm->getBaseSequence(),
psm->getFullSequence(),
psm->getPeptideMonisotopicMass().value(),
psm->getScanRetentionTime(),
psm->getScanPrecursorCharge(),
psmToProteinGroups[psm]);
flashLFQIdentifications.push_back(tempVar4);
}
}
// run FlashLFQ
auto flashLfqEngine = new FlashLfqEngine(flashLFQIdentifications,
getParameters()->getSearchParameters()->getNormalize(),
false,
getParameters()->getSearchParameters()->getMatchBetweenRuns(),
getParameters()->getSearchParameters()->getQuantifyPpmTol(),
5.0, 5.0, false, 2, false, true,
true,
GlobalVariables::getElementsLocation(),
getCommonParameters()->getMaxThreadsToUsePerFile());
if (!flashLFQIdentifications.empty())
{
getParameters()->setFlashLfqResults(flashLfqEngine->Run());
}
auto lfqr = getParameters()->getFlashLfqResults();
//MultiProtease MBR capability code
//Parameters.FlashLfqResults = null;
// EDGAR: NOte: this block was already commented out in the C# version
//foreach (var proteasePsms in proteaseSortedPsms)
//{
// var flashLFQIdentifications = new List<Identification>();
// var proteasePsmsGroupedByFile = proteasePsms.Value.GroupBy(p => p.FullFilePath);
// foreach (var spectraFile in proteasePsmsGroupedByFile)
// {
// var rawfileinfo = spectraFileInfo.Where(p => p.FullFilePathWithExtension.Equals(spectraFile.Key)).First();
// foreach (var psm in spectraFile)
// {
// flashLFQIdentifications.Add(new Identification(rawfileinfo, psm.BaseSequence, psm.FullSequence,
// psm.PeptideMonisotopicMass.Value, psm.ScanRetentionTime, psm.ScanPrecursorCharge, psmToProteinGroups[psm]));
// }
// }
// // run FlashLFQ
// var FlashLfqEngine = new FlashLFQEngine(
// allIdentifications: flashLFQIdentifications,
// normalize: Parameters.SearchParameters.Normalize,
// ppmTolerance: Parameters.SearchParameters.QuantifyPpmTol,
// matchBetweenRuns: Parameters.SearchParameters.MatchBetweenRuns,
// silent: true,
// optionalPeriodicTablePath: GlobalVariables.ElementsLocation);
// if (flashLFQIdentifications.Any())
// {
// //make specific to protease
// var results = FlashLfqEngine.Run();
// if (Parameters.FlashLfqResults == null)
// {
// Parameters.FlashLfqResults = results;
// }
// else
// {
// Parameters.FlashLfqResults.MergeResultsWith(results);
// }
// }
//}
// get protein intensity back from FlashLFQ
if (getProteinGroups().size() > 0 && getParameters()->getFlashLfqResults() != nullptr)
{
for (auto proteinGroup : getProteinGroups())
{
proteinGroup->setFilesForQuantification(spectraFileInfo);
proteinGroup->setIntensitiesByFile(std::unordered_map<SpectraFileInfo*, double>());
for (auto spectraFile : proteinGroup->getFilesForQuantification())
{
auto pg = getParameters()->getFlashLfqResults()->ProteinGroups;
if ( pg.find(proteinGroup->getProteinGroupName()) != pg.end() )
{
auto flashLfqProteinGroup = pg[proteinGroup->getProteinGroupName()];
proteinGroup->getIntensitiesByFile()[spectraFile] = flashLfqProteinGroup->GetIntensity(spectraFile);
}
else
{
proteinGroup->getIntensitiesByFile().emplace(spectraFile, 0);
}
}
}
}
delete flashLfqEngine;
//C# TO C++ CONVERTER TODO TASK: A 'delete undefinedPg' statement was not added since undefinedPg
//was passed to a method or constructor. Handle memory management manually.
}
void PostSearchAnalysisTask::HistogramAnalysis()
{
if (getParameters()->getSearchParameters()->getDoHistogramAnalysis())
{
std::vector<PeptideSpectralMatch*> limitedpsms_with_fdr;
for ( auto p : getParameters()->getAllPsms() ) {
if ( p->getFdrInfo()->getQValue() <= 0.01 ) {
limitedpsms_with_fdr.push_back(p);
}
}
bool any_cond = false;
for ( auto b: limitedpsms_with_fdr ) {
if ( !b->getIsDecoy() ) {
any_cond=true;
break;
}
}
if ( any_cond)
{
std::vector<std::string> svec = {getParameters()->getSearchTaskId()};
Status("Running histogram analysis...", svec, getVerbose() );
auto myTreeStructure = new BinTreeStructure();
myTreeStructure->GenerateBins(limitedpsms_with_fdr,
getParameters()->getSearchParameters()->getHistogramBinTolInDaltons());
auto writtenFile = getParameters()->getOutputFolder() + "/MassDifferenceHistogram.tsv";
WriteTree(myTreeStructure, writtenFile);
FinishedWritingFile(writtenFile, svec, getVerbose());
delete myTreeStructure;
}
}
}
void PostSearchAnalysisTask::WritePsmResults()
{
Status("Writing results...", getParameters()->getSearchTaskId(), getVerbose());
std::vector<PeptideSpectralMatch*> filteredPsmListForOutput;
for ( auto p : getParameters()->getAllPsms() ) {
if ( p->getFdrInfo()->getQValue() <= getCommonParameters()->getQValueOutputFilter() &&
p->getFdrInfo()->getQValueNotch() <= getCommonParameters()->getQValueOutputFilter() ) {
filteredPsmListForOutput.push_back(p);
}
}
if (!getParameters()->getSearchParameters()->getWriteDecoys())
{
std::remove_if (filteredPsmListForOutput.begin(), filteredPsmListForOutput.end(), [&] (PeptideSpectralMatch* b)
{return b->getIsDecoy();} );
}
if (!getParameters()->getSearchParameters()->getWriteContaminants())
{
std::remove_if (filteredPsmListForOutput.begin(), filteredPsmListForOutput.end(), [&] (PeptideSpectralMatch* b)
{return b->getIsContaminant();} );
}
// write PSMs
std::string writtenFile = getParameters()->getOutputFolder() + "/AllPSMs.psmtsv";
auto p = getParameters()->getSearchParameters()->getModsToWriteSelection();
WritePsmsToTsv(filteredPsmListForOutput, writtenFile, &p);
std::vector<std::string> tmpvecx = {getParameters()->getSearchTaskId()};
FinishedWritingFile(writtenFile, tmpvecx, getVerbose());
// write PSMs for percolator
writtenFile = getParameters()->getOutputFolder() + "/AllPSMs_FormattedForPercolator.tsv";
WritePsmsForPercolator(filteredPsmListForOutput, writtenFile, getCommonParameters()->getQValueOutputFilter());
FinishedWritingFile(writtenFile, tmpvecx, getVerbose());
// write best (highest-scoring) PSM per peptide
writtenFile = getParameters()->getOutputFolder() + "/AllPeptides.psmtsv";
#ifdef ORIG
// EDGAR: I don't think this needs a groupby, only first element is used. more like a distinct.
std::vector<PeptideSpectralMatch*> peptides = getParameters()->getAllPsms().GroupBy([&] (std::any b) {
b::FullSequence;
})->Select([&] (std::any b) {
b::FirstOrDefault();
}).ToList();
#endif
std::vector<PeptideSpectralMatch*> peptides;
for ( auto b: getParameters()->getAllPsms() ) {
bool found= false;
for ( auto p: peptides ) {
if (b->getFullSequence() == p->getFullSequence() ) {
found = true;
break;
}
}
if ( !found ) {
peptides.push_back(b);
}
}
#ifdef ORIG
//EDGAR: the same here.
WritePsmsToTsv(filteredPsmListForOutput.GroupBy([&] (std::any b) {
b::FullSequence;
})->Select([&] (std::any b) {
b::FirstOrDefault();
}).ToList(), writtenFile, getParameters()->getSearchParameters()->getModsToWriteSelection());
#endif
std::vector<PeptideSpectralMatch*> tmppeptides;
for ( auto b: filteredPsmListForOutput ) {
bool found= false;
for ( auto p: tmppeptides ) {
if (b->getFullSequence() == p->getFullSequence() ) {
found = true;
break;
}
}
if ( !found ) {
tmppeptides.push_back(b);
}
}
auto tempvar = getParameters()->getSearchParameters()->getModsToWriteSelection();
WritePsmsToTsv(tmppeptides, writtenFile, &tempvar);
std::vector<std::string> svec2 = {getParameters()->getSearchTaskId()};
FinishedWritingFile(writtenFile, svec2, getVerbose());
// write summary text
int count=0;
for ( auto a : getParameters()->getAllPsms() ) {
if ( a->getFdrInfo()->getQValue() <= 0.01 && !a->getIsDecoy() ) {
count++;
}
}
getParameters()->getSearchTaskResults()->AddNiceText("All target PSMS within 1% FDR: " + std::to_string(count));
count=0;
for ( auto a : peptides ) {
if ( a->getFdrInfo()->getQValue() <= 0.01 && !a->getIsDecoy() ) {
count++;
}
}
getParameters()->getSearchTaskResults()->AddNiceText("All target peptides within 1% FDR: " + std::to_string(count));
if (getParameters()->getSearchParameters()->getDoParsimony())
{
count=0;
for ( auto b : getProteinGroups() ) {
if ( b->getQValue() <= 0.01 && !b->getIsDecoy() ) {
count++;
}
}
getParameters()->getSearchTaskResults()->AddNiceText("All target protein groups within 1% FDR: " +
std::to_string(count) + "\r\n");
}
auto tmparg = new std::vector<std::pair<std::string, std::vector<PeptideSpectralMatch*>>>;
std::function<bool(PeptideSpectralMatch*,PeptideSpectralMatch*)> f1 = [&]
(PeptideSpectralMatch *l, PeptideSpectralMatch *r) {
return l->getFullFilePath() < r->getFullFilePath(); } ;
std::function<bool(PeptideSpectralMatch*,PeptideSpectralMatch*)> f2 = [&]
(PeptideSpectralMatch *l, PeptideSpectralMatch *r) {
return l->getFullFilePath() != r->getFullFilePath(); } ;
std::vector<std::vector<PeptideSpectralMatch*>> tmppsms= Group::GroupBy ( filteredPsmListForOutput, f1, f2);
for ( auto p: tmppsms ) {
tmparg->push_back(std::make_pair(p[0]->getFullFilePath(), p));
}
setPsmsGroupedByFile(*tmparg);
for (auto file : getPsmsGroupedByFile() )
{
// write summary text
auto psmsForThisFile = file.second; //->ToList();
std::string fname = file.first;
std::string strippedFileName = fname.substr(0, fname.find_last_of("."));
#ifdef ORIG
auto peptidesForFile = psmsForThisFile.GroupBy([&] (std::any b) {
b::FullSequence;
})->Select([&] (std::any b) {
b::FirstOrDefault();
}).ToList();
#endif
std::vector<PeptideSpectralMatch*> peptidesForFile;
for ( auto b : psmsForThisFile ) {
bool found = false;
for ( auto q: peptidesForFile ) {
if ( b->getFullSequence() == q->getFullSequence() ) {
found = true;
break;
}
}
if ( !found ) {
peptidesForFile.push_back(b);
}
}
getParameters()->getSearchTaskResults()->AddNiceText("MS2 spectra in " + strippedFileName + ": " +
std::to_string(getParameters()->getNumMs2SpectraPerFile()[strippedFileName][0]));
getParameters()->getSearchTaskResults()->AddNiceText("Precursors fragmented in " + strippedFileName +
": " + std::to_string(getParameters()->getNumMs2SpectraPerFile()[strippedFileName][1]));
int count =0;
for ( auto a: psmsForThisFile ) {
if ( a->getFdrInfo()->getQValue() <= 0.01 && !a->getIsDecoy() ) {
count++;
}
}
getParameters()->getSearchTaskResults()->AddNiceText("Target PSMs within 1% FDR in " + strippedFileName + ": "
+ std::to_string(count));
count = 0;
for ( auto a: peptidesForFile ) {
if ( a->getFdrInfo()->getQValue() <= 0.01 && !a->getIsDecoy() ) {
count++;
}
}
getParameters()->getSearchTaskResults()->AddNiceText("Target peptides within 1% FDR in " +
strippedFileName + ": " + std::to_string(count));
// writes all individual spectra file search results to subdirectory
if (getParameters()->getCurrentRawFileList().size() > 1)
{
// create individual files subdirectory
FileSystem::createDirectory(getParameters()->getIndividualResultsOutputFolder());
// write PSMs
writtenFile = getParameters()->getIndividualResultsOutputFolder() + "/" + strippedFileName + "_PSMs.psmtsv";
auto targ = getParameters()->getSearchParameters()->getModsToWriteSelection();
WritePsmsToTsv(psmsForThisFile, writtenFile, &targ);
std::vector<std::string> tmpvec = {getParameters()->getSearchTaskId(),
"Individual Spectra Files", file.second.front()->getFullFilePath()};
FinishedWritingFile(writtenFile, tmpvec, getVerbose() );
// write PSMs for percolator
writtenFile = getParameters()->getIndividualResultsOutputFolder() + "/" + strippedFileName +
"_PSMsFormattedForPercolator.tsv";
WritePsmsForPercolator(psmsForThisFile, writtenFile, getCommonParameters()->getQValueOutputFilter());
FinishedWritingFile(writtenFile, tmpvec, getVerbose() );
// write best (highest-scoring) PSM per peptide
writtenFile = getParameters()->getIndividualResultsOutputFolder() + "/" + strippedFileName + "_Peptides.psmtsv";
auto targ2 = getParameters()->getSearchParameters()->getModsToWriteSelection();
WritePsmsToTsv(peptidesForFile, writtenFile, &targ2);
FinishedWritingFile(writtenFile, tmpvec, getVerbose());
}
}
}
void PostSearchAnalysisTask::WriteProteinResults()
{
if (getParameters()->getSearchParameters()->getDoParsimony())
{
// write protein groups to tsv
std::string writtenFile = getParameters()->getOutputFolder() + "/AllProteinGroups.tsv";
auto tvar = getProteinGroups();
auto tvar2 = getCommonParameters()->getQValueOutputFilter();
std::vector<std::string> tvec = {getParameters()->getSearchTaskId()};
WriteProteinGroupsToTsv( tvar, writtenFile, tvec, tvar2 );
// write all individual file results to subdirectory
// local protein fdr, global parsimony, global psm fdr
if (getParameters()->getCurrentRawFileList().size() > 1 ||
getParameters()->getSearchParameters()->getWriteMzId() ||
getParameters()->getSearchParameters()->getWritePepXml())
{
FileSystem::createDirectory(getParameters()->getIndividualResultsOutputFolder());
std::vector<std::string> tmpFilePath;
for ( auto v: getPsmsGroupedByFile() ) {
tmpFilePath.push_back(v.first);
}
for (auto fullFilePath : tmpFilePath )
{
std::string strippedFileName = fullFilePath.substr(0,fullFilePath.find_last_of("."));
std::vector<PeptideSpectralMatch*> psmsForThisFile;
for ( auto p: getPsmsGroupedByFile() ) {
if ( p.first == fullFilePath ) {
for ( auto g : p.second ) {
psmsForThisFile.push_back(g);
}
}
}
std::vector<EngineLayer::ProteinGroup*> subsetProteinGroupsForThisFile;
for ( auto p: getProteinGroups() ) {
subsetProteinGroupsForThisFile.push_back(p->ConstructSubsetProteinGroup(fullFilePath));
}
std::vector<std::string> tmpvec = {getParameters()->getSearchTaskId(),
"Individual Spectra Files", fullFilePath};
auto tempVar = new ProteinScoringAndFdrEngine (subsetProteinGroupsForThisFile, psmsForThisFile,
getParameters()->getSearchParameters()->getNoOneHitWonders(),
getParameters()->getSearchParameters()->getModPeptidesAreDifferent(),
false, getCommonParameters(),
tmpvec , getVerbose());
ProteinScoringAndFdrResults *subsetProteinScoringAndFdrResults = static_cast<ProteinScoringAndFdrResults*>(tempVar->Run());
subsetProteinGroupsForThisFile = subsetProteinScoringAndFdrResults->SortedAndScoredProteinGroups;
int count=0;
for ( auto b: subsetProteinGroupsForThisFile) {
if ( b->getQValue() <= 0.01 && !b->getIsDecoy() ) {
count++;
}
}
getParameters()->getSearchTaskResults()->AddNiceText("Target protein groups within 1 % FDR in " +
strippedFileName + ": " + std::to_string(count));
// write individual spectra file protein groups results to tsv
if (getParameters()->getCurrentRawFileList().size() > 1)
{
writtenFile = getParameters()->getIndividualResultsOutputFolder() +"/" +
strippedFileName.substr(strippedFileName.find_last_of("/")) + "_ProteinGroups.tsv";
std::vector<std::string> tmpvec2;
tmpvec2.push_back(getParameters()->getSearchTaskId());
tmpvec2.push_back("Individual Spectra Files");
tmpvec2.push_back(fullFilePath);
auto targ = getCommonParameters()->getQValueOutputFilter();
WriteProteinGroupsToTsv(subsetProteinGroupsForThisFile, writtenFile,
tmpvec2, targ);
}
// write mzID
if (getParameters()->getSearchParameters()->getWriteMzId())
{
std::vector<std::string> tmpvec2a;
tmpvec2a.push_back(getParameters()->getSearchTaskId());
tmpvec2a.push_back("Individual Spectra Files");
tmpvec2a.push_back(fullFilePath);
Status("Writing mzID...", tmpvec2a, getVerbose());
auto mzidFilePath = getParameters()->getIndividualResultsOutputFolder() + "/" +
strippedFileName.substr(strippedFileName.find_last_of("/")) + ".mzID";
auto targ1 = getParameters()->getVariableModifications();
auto targ2 = getParameters()->getFixedModifications();
std::vector<Protease*> vecarg1 = {getCommonParameters()->getDigestionParams()->getProtease()};
MzIdentMLWriter::WriteMzIdentMl(psmsForThisFile, subsetProteinGroupsForThisFile,
targ1, targ2, vecarg1,
getCommonParameters()->getQValueOutputFilter(),
getCommonParameters()->getProductMassTolerance(),
getCommonParameters()->getPrecursorMassTolerance(),
getCommonParameters()->getDigestionParams()->getMaxMissedCleavages(),
mzidFilePath);
FinishedWritingFile(mzidFilePath, tmpvec2a, getVerbose());
}
// write pepXML
if (getParameters()->getSearchParameters()->getWritePepXml())
{
std::vector<std::string> svec;
svec.push_back(getParameters()->getSearchTaskId());
svec.push_back("Individual Spectra Files");
svec.push_back(fullFilePath);
Status("Writing pepXML...", svec, getVerbose());
auto pepXMLFilePath = getParameters()->getIndividualResultsOutputFolder() + "/" +
strippedFileName.substr(strippedFileName.find_last_of("/")) + ".pep.XM";
auto tempvar = getParameters()->getDatabaseFilenameList();
auto tvar = getParameters()->getVariableModifications();
auto tvar2 = getParameters()->getFixedModifications();
PepXMLWriter::WritePepXml(psmsForThisFile, tempvar, tvar, tvar2,
getCommonParameters(), pepXMLFilePath,
getCommonParameters()->getQValueOutputFilter());
FinishedWritingFile(pepXMLFilePath, svec, getVerbose() );
}
std::vector<std::string> tmpvec5;
tmpvec5.push_back(getParameters()->getSearchTaskId());
tmpvec5.push_back("Individual Spectra Files");
tmpvec5.push_back(fullFilePath);
ProgressEventArgs tempVar2(100, "Done!", tmpvec5 );
ReportProgress(&tempVar2, getVerbose());
}
}
}
}
void PostSearchAnalysisTask::WriteQuantificationResults()
{
if (getParameters()->getSearchParameters()->getDoQuantification() &&
getParameters()->getFlashLfqResults() != nullptr)
{
// write peaks
std::vector<std::string> tmpvec = {getParameters()->getSearchTaskId()};
WritePeakQuantificationResultsToTsv(getParameters()->getFlashLfqResults(),
getParameters()->getOutputFolder(),
"AllQuantifiedPeaks",
tmpvec);
// write peptide quant results
WritePeptideQuantificationResultsToTsv(getParameters()->getFlashLfqResults(),
getParameters()->getOutputFolder(),
"AllQuantifiedPeptides",
tmpvec );
// write individual results
if (getParameters()->getCurrentRawFileList().size() > 1)
{
for (auto file : getParameters()->getFlashLfqResults()->Peaks)
{
std::vector<std::string> vec3 = {getParameters()->getSearchTaskId(),
"Individual Spectra Files",
file.first->FullFilePathWithExtension};
WritePeakQuantificationResultsToTsv(getParameters()->getFlashLfqResults(),
getParameters()->getIndividualResultsOutputFolder(),
file.first->FilenameWithoutExtension + "_QuantifiedPeaks",
vec3);
}
}
}
}
void PostSearchAnalysisTask::WritePrunedDatabase()
{
if (getParameters()->getSearchParameters()->getWritePrunedDatabase())
{
std::vector<std::string> tempvec = {getParameters()->getSearchTaskId()};
Status("Writing Pruned Database...", tempvec, getVerbose());
std::unordered_set<Modification*> modificationsToWriteIfBoth;
std::unordered_set<Modification*> modificationsToWriteIfInDatabase;
std::unordered_set<Modification*> modificationsToWriteIfObserved;
std::vector<PeptideSpectralMatch* > confidentPsms;
for ( auto b: getParameters()->getAllPsms() ) {
if ( b->getFdrInfo()->getQValueNotch() <= 0.01 &&
b->getFdrInfo()->getQValue() <= 0.01 &&
!b->getIsDecoy() &&
b->getBaseSequence().length() != 0 ){
confidentPsms.push_back(b);
}
}
auto proteinToConfidentBaseSequences = std::unordered_map<Protein*, std::vector<PeptideWithSetModifications*>>();
// associate all confident PSMs with all possible proteins they could be digest products of (before or after parsimony)
for (auto psm : confidentPsms)
{
std::vector<PeptideWithSetModifications *> myPepsWithSetMods;
for ( auto p: psm->getBestMatchingPeptides() ) {
myPepsWithSetMods.push_back(std::get<1>(p) );
}
for (auto peptide : myPepsWithSetMods)
{
std::unordered_map<Protein*, std::vector<PeptideWithSetModifications*>>::const_iterator proteinToConfidentBaseSequences_iterator = proteinToConfidentBaseSequences.find(peptide->getProtein()->getNonVariantProtein());
if (proteinToConfidentBaseSequences_iterator != proteinToConfidentBaseSequences.end())
{
proteinToConfidentBaseSequences[peptide->getProtein()->getNonVariantProtein()].push_back(peptide);
}
else
{
std::vector<PeptideWithSetModifications*> tvec = {peptide};
proteinToConfidentBaseSequences.emplace(peptide->getProtein()->getNonVariantProtein(), tvec);
}
}
}
// Add user mod selection behavours to Pruned DB
for (auto modType : getParameters()->getSearchParameters()->getModsToWriteSelection())
{
for (Modification *mod : GlobalVariables::getAllModsKnown() )
{
if ( mod->getModificationType() != modType.first ) {
continue;
}
if (modType.second == 1) // Write if observed and in database
{
modificationsToWriteIfBoth.insert(mod);
}
if (modType.second == 2) // Write if in database
{
modificationsToWriteIfInDatabase.insert(mod);
}
if (modType.second == 3) // Write if observed
{
modificationsToWriteIfObserved.insert(mod);
}
}
}
//generates dictionary of proteins with only localized modifications
std::vector<PeptideSpectralMatch* > ModPsms;
for ( auto b: getParameters()->getAllPsms() ) {
if ( b->getFdrInfo()->getQValueNotch() <= 0.01 &&
b->getFdrInfo()->getQValue() <= 0.01 &&
!b->getIsDecoy() &&
b->getFullSequence().length() != 0 ){
ModPsms.push_back(b);
}
}
std::unordered_map<Protein*, std::vector<PeptideWithSetModifications*>> proteinToConfidentModifiedSequences;
for (auto psm : ModPsms)
{
std::vector<PeptideWithSetModifications *> myPepsWithSetMods;
for ( auto p: psm->getBestMatchingPeptides() ) {
myPepsWithSetMods.push_back( std::get<1>(p) );
}
for (auto peptide : myPepsWithSetMods)
{
std::unordered_map<Protein*, std::vector<PeptideWithSetModifications*>>::const_iterator proteinToConfidentModifiedSequences_iterator =
proteinToConfidentModifiedSequences.find(peptide->getProtein()->getNonVariantProtein());
if (proteinToConfidentModifiedSequences_iterator != proteinToConfidentModifiedSequences.end())
{
proteinToConfidentModifiedSequences[peptide->getProtein()->getNonVariantProtein()].push_back(peptide);
}
else
{
std::vector<PeptideWithSetModifications*> tvar = {peptide};
proteinToConfidentModifiedSequences.emplace(peptide->getProtein()->getNonVariantProtein(), tvar);
}
}
}
// mods included in pruned database will only be confidently localized mods (peptide's FullSequence != null)
std::vector<Protein*> tmpVarProtein;
for (auto p: getParameters()->getProteinList() ) {
bool found = false;
for ( auto q : tmpVarProtein ) {
if ( p->getNonVariantProtein()->Equals(q) ) {
found = true;
break;
}
}
if ( !found ) {
tmpVarProtein.push_back( p->getNonVariantProtein());
}
}
for ( auto nonVariantProtein : tmpVarProtein )
{
if (!nonVariantProtein->getIsDecoy())
{
std::vector<PeptideWithSetModifications*> psms;
std::unordered_map<Protein*, std::vector<PeptideWithSetModifications*>>::const_iterator proteinToConfidentModifiedSequences_iterator =
proteinToConfidentModifiedSequences.find(nonVariantProtein);
psms = proteinToConfidentModifiedSequences_iterator->second;
// sequence variant is null if mod is not on a variant
//std::unordered_set<std::tuple<int, Modification*, SequenceVariation*>> modsObservedOnThisProtein;
PSATTuple1_set modsObservedOnThisProtein;
for (auto psm : (psms.size() != 0 ) ? psms : std::vector<PeptideWithSetModifications*>())
{
for (auto idxModKV : psm->getAllModsOneIsNterminus())
{
int proteinIdx = GetOneBasedIndexInProtein(idxModKV.first, psm);
SequenceVariation *relevantVariant=nullptr;
for ( auto sv : psm->getProtein()->getAppliedSequenceVariations() ) {
if ( VariantApplication::IsSequenceVariantModification(sv, proteinIdx) ) {
relevantVariant = sv;
break;
}
}
SequenceVariation *unappliedVariant = nullptr;
if ( relevantVariant != nullptr ) {
for ( auto sv : psm->getProtein()->getSequenceVariations() ) {
if ( sv->getDescription() != nullptr &&
sv->getDescription()->Equals(relevantVariant->getDescription()) ) {
unappliedVariant = sv;
break;
}
}
}
modsObservedOnThisProtein.insert(std::make_tuple(
VariantApplication::RestoreModificationIndex(psm->getProtein(),
proteinIdx),
idxModKV.second,
unappliedVariant));
}
}
//std::unordered_map<std::tuple<SequenceVariation*, int>, std::vector<Modification*>> modsToWrite;
PSATTuple2_map modsToWrite;
//Add if observed (regardless if in database)
for (auto observedMod : modsObservedOnThisProtein)
{
auto tempMod = std::get<1>(observedMod);
if (std::find(modificationsToWriteIfObserved.begin(), modificationsToWriteIfObserved.end(), tempMod) !=
modificationsToWriteIfObserved.end())
{
auto svIdxKey = std::make_tuple(std::get<2>(observedMod), std::get<0>(observedMod));
if (modsToWrite.find(svIdxKey) == modsToWrite.end())
{
std::vector<Modification*> tvec = {std::get<1>(observedMod)};
modsToWrite.emplace(svIdxKey, tvec);
}
else
{
modsToWrite[svIdxKey].push_back(std::get<1>(observedMod));
}
}
}
// Add modification if in database (two cases: always or if observed)
for (auto modkv : nonVariantProtein->getOneBasedPossibleLocalizedModifications() )
{
for (auto mod : modkv.second)
{
//Add if always In Database or if was observed and in database and not set to not include
if (std::find(modificationsToWriteIfInDatabase.begin(), modificationsToWriteIfInDatabase.end(), mod) !=
modificationsToWriteIfInDatabase.end() ||
(std::find(modificationsToWriteIfBoth.begin(), modificationsToWriteIfBoth.end(), mod) !=
modificationsToWriteIfBoth.end() &&
std::find(modsObservedOnThisProtein.begin(), modsObservedOnThisProtein.end(),
std::make_tuple(modkv.first, mod, nullptr) ) != modsObservedOnThisProtein.end())) {
if (modsToWrite.find(std::make_tuple(nullptr, modkv.first)) == modsToWrite.end())
{
modsToWrite.emplace(std::make_tuple(nullptr, modkv.first), std::vector<Modification*> {mod});
}
else
{
modsToWrite[std::make_tuple(nullptr, modkv.first)].push_back(mod);
}
}
}
}
// Add variant modification if in database (two cases: always or if observed)
for (SequenceVariation *sv : nonVariantProtein->getSequenceVariations())
{
for (auto modkv : sv->getOneBasedModifications())
{
for (auto mod : modkv.second)
{
//Add if always In Database or if was observed and in database and not set to not include
if (std::find(modificationsToWriteIfInDatabase.begin(), modificationsToWriteIfInDatabase.end(), mod) !=
modificationsToWriteIfInDatabase.end() ||
(std::find(modificationsToWriteIfBoth.begin(), modificationsToWriteIfBoth.end(), mod) !=
modificationsToWriteIfBoth.end() &&
std::find(modsObservedOnThisProtein.begin(), modsObservedOnThisProtein.end(),
std::make_tuple(modkv.first, mod, sv)) != modsObservedOnThisProtein.end()) )
{
if (modsToWrite.find(std::make_tuple(sv, modkv.first)) == modsToWrite.end())
{
modsToWrite.emplace(std::make_tuple(sv, modkv.first), std::vector<Modification*> {mod});
}
else
{
modsToWrite[std::make_tuple(sv, modkv.first)].push_back(mod);
}
}
}
}
}
if (proteinToConfidentBaseSequences.find(nonVariantProtein->getNonVariantProtein()) !=
proteinToConfidentBaseSequences.end())
{
// adds confidently localized and identified mods
nonVariantProtein->getOneBasedPossibleLocalizedModifications().clear();
for (auto kvp : modsToWrite)
{
if ( std::get<0>(kvp.first) != nullptr )
{
continue;
}
nonVariantProtein->getOneBasedPossibleLocalizedModifications()[std::get<1>(kvp.first)] = kvp.second;
}
for (auto sv : nonVariantProtein->getSequenceVariations())
{
sv->getOneBasedModifications().clear();
for (auto kvp : modsToWrite )
{
if ( std::get<0>(kvp.first) == nullptr ||
!(std::get<0>(kvp.first))->Equals(sv) ) {
continue;
}
sv->getOneBasedModifications()[std::get<1>(kvp.first)] = kvp.second;
}
}
}
}
//writes all proteins
bool cond = false;
for ( auto b: getParameters()->getDatabaseFilenameList() ) {
if ( !b->getIsContaminant() ) {
cond = true;
break;
}
}
bool cond2 = false;
for ( auto b: getParameters()->getDatabaseFilenameList() ) {
if ( b->getIsContaminant() ) {
cond2 = true;
break;
}
}
//Edgar: calculcate the basename only once to avoid repetitive code.
std::string outputXMLdbBaseNameWO, outputXMLdbBaseName;
if ( cond) {
std::vector<std::string> fnameVec;
for ( auto b: getParameters()->getDatabaseFilenameList() ) {
if ( !b->getIsContaminant() ) {
std::string fname = b->getFilePath();
std::string fname_short = fname.substr(0, fname.find_last_of("."));
fnameVec.push_back(fname_short);
}
}
std::string del="-";
outputXMLdbBaseNameWO = getParameters()->getOutputFolder() + "/" + StringHelper::join(fnameVec, del);
}
if ( cond2 ) {
std::vector<std::string> fnameVec;
for ( auto b: getParameters()->getDatabaseFilenameList() ) {
if ( b->getIsContaminant() ) {
std::string fname = b->getFilePath();
std::string fname_short = fname.substr(0, fname.find_last_of("."));
fnameVec.push_back(fname_short);
}
}
std::string del="-";
outputXMLdbBaseName = getParameters()->getOutputFolder() + "/" + StringHelper::join(fnameVec, del);
}
if ( cond)
{
#ifdef ORIG
std::string outputXMLdbFullName = FileSystem::combine(getParameters()->getOutputFolder(),
std::string::Join("-", getParameters()->getDatabaseFilenameList().Where([&] (std::any b) {
!b::IsContaminant;
})->Select([&] (std::any b) {
Path::GetFileNameWithoutExtension(b::FilePath);
})) + "pruned.xml");
#endif
std::string outputXMLdbFullName = outputXMLdbBaseNameWO + "pruned.xml";
#ifdef ORG
ProteinDbWriter::WriteXmlDatabase(std::unordered_map<std::string, std::unordered_set<std::tuple<int, Modification*>>>(), getParameters()->getProteinList().Select([&] (std::any p) {
p::NonVariantProtein;
}).Where([&] (std::any b) {
return !b::IsDecoy && !b::IsContaminant;
}).ToList(), outputXMLdbFullName);
#endif
std::vector<Protein*> proteinList;
for ( auto p: getParameters()->getProteinList() ) {
auto b = p->getNonVariantProtein();
if ( !b->getIsDecoy() && !b->getIsContaminant() ) {
proteinList.push_back(p);
}
}
std::unordered_map<std::string,ModDbTuple_set> tmpmap;
ProteinDbWriter::WriteXmlDatabase(tmpmap, proteinList, outputXMLdbFullName);
std::vector<std::string> tmpvec = {getParameters()->getSearchTaskId()};
FinishedWritingFile(outputXMLdbFullName, tmpvec, getVerbose());
}
if ( cond2 )
{
#ifdef ORIG
std::string outputXMLdbFullNameContaminants = FileSystem::combine(getParameters()->getOutputFolder(),
std::string::Join("-", getParameters()->getDatabaseFilenameList().Where([&] (std::any b) {
b::IsContaminant;
})->Select([&] (std::any b) {
Path::GetFileNameWithoutExtension(b::FilePath);
})) + "pruned.xml");
#endif
std::string outputXMLdbFullNameContaminants = outputXMLdbBaseName + "pruned.xml";
#ifdef ORIG
ProteinDbWriter::WriteXmlDatabase(std::unordered_map<std::string, std::unordered_set<std::tuple<int, Modification*>>>(),
getParameters()->getProteinList().Select([&] (std::any p) {
p::NonVariantProtein;
}).Where([&] (std::any b) {
return !b::IsDecoy && b::IsContaminant;
}).ToList(), outputXMLdbFullNameContaminants);
#endif
std::vector<Protein*> proteinList;
for ( auto p: getParameters()->getProteinList() ) {
auto b = p->getNonVariantProtein();
if ( !b->getIsDecoy() && b->getIsContaminant() ) {
proteinList.push_back(p);
}
}
std::unordered_map<std::string, ModDbTuple_set> tmpmap;
ProteinDbWriter::WriteXmlDatabase(tmpmap, proteinList, outputXMLdbFullNameContaminants);
std::vector<std::string> tmpvec = {getParameters()->getSearchTaskId()};
FinishedWritingFile(outputXMLdbFullNameContaminants, tmpvec, getVerbose());
}
//writes only detected proteins
if ( cond)
{
#ifdef ORIG
std::string outputXMLdbFullName = FileSystem::combine(getParameters()->getOutputFolder(),
std::string::Join("-", getParameters()->getDatabaseFilenameList().Where([&] (std::any b) {
!b::IsContaminant;
})->Select([&] (std::any b) {
Path::GetFileNameWithoutExtension(b::FilePath);
})) + "proteinPruned.xml");
#endif
std::string outputXMLdbFullName = outputXMLdbBaseNameWO + "proteinPruned.xml";
#ifdef ORIG
ProteinDbWriter::WriteXmlDatabase(std::unordered_map<std::string, std::unordered_set<std::tuple<int, Modification*>>>(),
proteinToConfidentBaseSequences.Keys->Where([&] (std::any b) {
return !b::IsDecoy && !b::IsContaminant;
}).ToList(), outputXMLdbFullName);
#endif
std::vector<Protein*> proteinList;
for ( auto p: proteinToConfidentBaseSequences ) {
auto b = std::get<0>(p);
if ( !b->getIsDecoy() && !b->getIsContaminant() ) {
proteinList.push_back(b);
}
}
std::unordered_map<std::string, ModDbTuple_set> tmpmap;
ProteinDbWriter::WriteXmlDatabase(tmpmap, proteinList, outputXMLdbFullName);
std::vector<std::string> tmpvec = {getParameters()->getSearchTaskId()};
FinishedWritingFile(outputXMLdbFullName, tmpvec, getVerbose());
}
if ( cond2 )
{
#ifdef ORIG
std::string outputXMLdbFullNameContaminants = FileSystem::combine(getParameters()->getOutputFolder(),
std::string::Join("-", getParameters()->getDatabaseFilenameList().Where([&] (std::any b) {
b::IsContaminant;
})->Select([&] (std::any b) {
Path::GetFileNameWithoutExtension(b::FilePath);
})) + "proteinPruned.xml");
#endif
std::string outputXMLdbFullNameContaminants = outputXMLdbBaseName + "proteinPruned.xml";
#ifdef ORIG
ProteinDbWriter::WriteXmlDatabase(std::unordered_map<std::string, std::unordered_set<std::tuple<int, Modification*>>>(),
proteinToConfidentBaseSequences.Keys->Where([&] (std::any b) {
return !b::IsDecoy && b::IsContaminant;
}).ToList(), outputXMLdbFullNameContaminants);
#endif
std::vector<Protein*> proteinList;
for ( auto p: proteinToConfidentBaseSequences ) {
auto b = std::get<0>(p);
if ( !b->getIsDecoy() && b->getIsContaminant() ) {
proteinList.push_back(b);
}
}
std::unordered_map<std::string, ModDbTuple_set> tmpmap;
ProteinDbWriter::WriteXmlDatabase(tmpmap, proteinList, outputXMLdbFullNameContaminants);
std::vector<std::string> tmpvec = {getParameters()->getSearchTaskId()};
FinishedWritingFile(outputXMLdbFullNameContaminants, tmpvec, getVerbose());
}
}
}
}
int PostSearchAnalysisTask::GetOneBasedIndexInProtein(int oneIsNterminus, PeptideWithSetModifications *peptideWithSetModifications)
{
if (oneIsNterminus == 1)
{
return peptideWithSetModifications->getOneBasedStartResidueInProtein();
}
if (oneIsNterminus == peptideWithSetModifications->getLength() + 2)
{
return peptideWithSetModifications->getOneBasedEndResidueInProtein();
}
return peptideWithSetModifications->getOneBasedStartResidueInProtein() + oneIsNterminus - 2;
}
void PostSearchAnalysisTask::WriteTree(BinTreeStructure *myTreeStructure, const std::string &writtenFile)
{
std::ofstream output(writtenFile);
output << "MassShift\tCount\tCountDecoy\tCountTarget\tCountLocalizeableTarget\tCountNonLocalizeableTarget\tFDR\tArea 0.01t\tArea 0.255\tFracLocalizeableTarget\tMine\tUnimodID\tUnimodFormulas\tUnimodDiffs\tAA\tCombos\tModsInCommon\tAAsInCommon\tResidues\tprotNtermLocFrac\tpepNtermLocFrac\tpepCtermLocFrac\tprotCtermLocFrac\tFracWithSingle\tOverlappingFrac\tMedianLength\tUniprot" << std::endl;
auto tmpBins = myTreeStructure->getFinalBins();
std::sort(tmpBins.begin(), tmpBins.end(), [&] (Bin *l, Bin *r) {
return l->getCount() > r->getCount(); });
for ( Bin *bin: tmpBins )
{
#ifdef ORIG
std::string tmpstring1 = std::string::Join(",", bin->ModsInCommon::OrderByDescending([&] (std::any b){
b->Value;
}).Where([&] (std::any b) {
return b->Value > bin->CountTarget / 10.0;
})->Select([&] (std::any b) {
return b::Key + ":" + (static_cast<double>(b->Value) / bin->CountTarget).ToString("F3");
}));
#endif
std::vector<std::tuple<std::string, int>> tmpvec;
for ( auto b: bin->ModsInCommon ) {
if ( std::get<1>(b) > (bin->getCountTarget()/10.0) ) {
tmpvec.push_back(b);
}
}
std::sort(tmpvec.begin(), tmpvec.end(), [&] (std::tuple<std::string, int> l, std::tuple<std::string, int> r) {
return std::get<1>(l) > std::get<1>(r);
});
std::vector<std::string> tmpstringvec;
for ( auto b: tmpvec ) {
std::stringstream ss;
ss << std::get<0>(b) << ":" << std::to_string(static_cast<double>(std::get<1>(b)) / bin->getCountTarget());
std::string s = ss.str();
tmpstringvec.push_back(s);
}
std::string del = ",";
std::string tmpstring1 = StringHelper::join(tmpstringvec, del);
#ifdef ORIG
std::string tmpstring2 = std::string::Join(",", bin->AAsInCommon::OrderByDescending([&] (std::any b){
b->Value;
}).Where([&] (std::any b) {
return b->Value > bin->CountTarget / 10.0;
})->Select([&] (std::any b) {
return b::Key + ":" + (static_cast<double>(b->Value) / bin->CountTarget).ToString("F3");
}));
#endif
std::vector<std::tuple<char, int>> tmpvec2;
for ( auto b: bin->getAAsInCommon() ) {
if ( std::get<1>(b) > (bin->getCountTarget()/10.0) ) {
tmpvec2.push_back(b);
}
}
std::sort(tmpvec2.begin(), tmpvec2.end(), [&] (std::tuple<char, int> l, std::tuple<char, int> r) {
return std::get<1>(l) > std::get<1>(r);
});
tmpstringvec.clear();
for ( auto b: tmpvec2 ) {
std::stringstream ss;
ss << std::get<0>(b) << ":" << std::to_string(static_cast<double>(std::get<1>(b)) / bin->getCountTarget());
std::string s = ss.str();
tmpstringvec.push_back(s);
}
std::string tmpstring2 = StringHelper::join(tmpstringvec, del);
#ifdef ORIG
std::string tmpstring3 = std::string::Join(",", bin->ResidueCount::OrderByDescending([&] (std::any b) {
b->Value;
})->Select([&] (std::any b){
return b::Key + ":" + b->Value;
}));
#endif
tmpvec2.clear();
for ( auto b: bin->ResidueCount ) {
tmpvec2.push_back(b);
}
std::sort(tmpvec2.begin(), tmpvec2.end(), [&] (std::tuple<char, int> l, std::tuple<char, int> r) {
return std::get<1>(l) > std::get<1>(r);
});
tmpstringvec.clear();
for ( auto b: tmpvec2 ) {
std::stringstream ss;
ss << std::get<0>(b) << ":" << std::get<1>(b);
std::string s = ss.str();
tmpstringvec.push_back(s);
}
std::string tmpstring3 = StringHelper::join(tmpstringvec, del);
output << std::setprecision(4) << bin->getMassShift() << "\t" << //MassShift
bin->getCount() << "\t" << //Count
bin->getCountDecoy() << "\t" << //CountDecoy
bin->getCountTarget()<< "\t" << //CountTarget
bin->getLocalizeableTarget() << "\t" << //CountLocalizeableTarget
(bin->getCountTarget() - bin->getLocalizeableTarget()) << "\t" << //CountNonLocalizeableTarget
(bin->getCount() == 0 ? NAN : static_cast<double>(bin->getCountDecoy() / bin->getCount())) << "\t" << //FDR
Math::NormalDistribution ( 0, 1, bin->ComputeZ(0.01)) << "\t" << //Area 0.01
Math::NormalDistribution (0, 1, bin->ComputeZ(0.255)) << "\t" << //Area 0.255
(bin->getCountTarget() == 0 ? NAN : static_cast<double>(bin->getLocalizeableTarget() / bin->getCountTarget())) << "\t" << //FracLocalizeableTarget
bin->getMine() << "\t" << //Mine
bin->getUnimodId() << "\t" << //UnimodID
bin->getUnimodFormulas() << "\t" << //UnimodFormulas
bin->getUnimodDiffs() << "\t" << //UnimodDiffs
bin->AA << "\t" << //AA
bin->getCombos() << "\t" << //Combos
tmpstring1 + "\t" << //ModsInCommon
tmpstring2 + "\t" << //AAsInCommon
tmpstring3 + "\t" << //Residues
(bin->getLocalizeableTarget() == 0 ? NAN : static_cast<double>(bin->getProtNlocCount() / bin->getLocalizeableTarget())) << "\t" << //protNtermLocFrac
(bin->getLocalizeableTarget() == 0 ? NAN : static_cast<double>(bin->getPepNlocCount() / bin->getLocalizeableTarget())) << "\t" << //pepNtermLocFrac
(bin->getLocalizeableTarget() == 0 ? NAN : static_cast<double>(bin->getPepClocCount() / bin->getLocalizeableTarget())) << "\t" << //pepCtermLocFrac
(bin->getLocalizeableTarget() == 0 ? NAN : static_cast<double>(bin->getProtClocCount() / bin->getLocalizeableTarget())) << "\t" << //protCtermLocFrac
bin->getFracWithSingle() << "\t" << //FracWithSingle
(static_cast<double>(bin->getOverlapping()) / bin->getCountTarget()) << "\t" << //OverlappingFrac
bin->getMedianLength() << "\t" << //MedianLength
bin->getUniprotID() << std::endl; //Uniprot
}
output.close();
}
void PostSearchAnalysisTask::WritePsmsForPercolator(std::vector<PeptideSpectralMatch*> &psmList,
const std::string &writtenFileForPercolator,
double qValueCutoff)
{
std::ofstream output(writtenFileForPercolator);
output << "SpecId\tLabel\tScanNr\tF1\tF2\tPeptide\tProteins" << std::endl;
output << "DefaultDirection\t-\t-\t1\t1\t\t" << std::endl;
for (int i = 0; i < (int)psmList.size(); i++)
{
auto psm = psmList[i];
if (psm->getFdrInfo()->getQValue() > qValueCutoff || psm->getFdrInfo()->getQValueNotch() > qValueCutoff)
{
continue;
}
output << std::to_string(i);
output << '\t' << std::to_string(psm->getIsDecoy() ? -1 : 1);
output << '\t' << psm->getScanNumber();
// Features
std::string del = "\t";
auto vec = psm->getFeatures();
std::vector<std::string> stringvec;
for ( auto v: vec ) {
stringvec.push_back(std::to_string(v));
}
output << StringHelper::toString('\t') << StringHelper::join(stringvec, del );
// HACKY: Ignores all ambiguity
auto pwsm = std::get<1>(psm->getBestMatchingPeptides().front());
output << '\t' << pwsm->getPreviousAminoAcid() << "." << pwsm->getFullSequence() << "." << pwsm->getNextAminoAcid();
output << '\t' << pwsm->getProtein()->getAccession();
output << std::endl;
}
output.close();
}
void PostSearchAnalysisTask::WriteProteinGroupsToTsv(std::vector<EngineLayer::ProteinGroup*> &proteinGroups,
const std::string &filePath,
std::vector<std::string> &nestedIds,
double qValueCutoff)
{
if ( proteinGroups.size() > 0 )
{
std::ofstream output(filePath);
output << proteinGroups.front()->GetTabSeparatedHeader() << std::endl;
for (int i = 0; i < (int)proteinGroups.size(); i++)
{
if ((!getParameters()->getSearchParameters()->getWriteDecoys() &&
proteinGroups[i]->getIsDecoy()) ||
(!getParameters()->getSearchParameters()->getWriteContaminants() &&
proteinGroups[i]->getIsContaminant()))
{
continue;
}
else if (proteinGroups[i]->getQValue() <= qValueCutoff)
{
output << proteinGroups[i]->ToString() << std::endl;
}
}
}
FinishedWritingFile(filePath, nestedIds, getVerbose());
}
void PostSearchAnalysisTask::WritePeptideQuantificationResultsToTsv(FlashLfqResults *flashLFQResults,
const std::string &outputFolder,
const std::string &fileName,
std::vector<std::string> &nestedIds)
{
auto fullSeqPath = outputFolder +"/" + fileName + ".tsv";
std::string s1="", s2="";
flashLFQResults->WriteResults(s1, fullSeqPath, s2);
FinishedWritingFile(fullSeqPath, nestedIds, getVerbose());
}
void PostSearchAnalysisTask::WritePeakQuantificationResultsToTsv(FlashLfqResults *flashLFQResults,
const std::string &outputFolder,
const std::string &fileName,
std::vector<std::string> &nestedIds)
{
auto peaksPath = outputFolder + "/" + fileName + ".tsv";
std::string s1="", s2="";
flashLFQResults->WriteResults(peaksPath, s1, s2);
FinishedWritingFile(peaksPath, nestedIds, getVerbose());
}
}
|
# include <iostream>
# include <vector>
# include <list>
# include <set>
using namespace std;
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n, m, a, b, v1, v2, ans;
set<pair<int, int>> s;
cin >> n >> m >> a >> b;
vector<list<int>> adj_list(n);
vector<int> deg(n);
vector<bool> inset(n, true);
while (m--) {
cin >> v1 >> v2; --v1; --v2;
adj_list[v1].push_back(v2); adj_list[v2].push_back(v1);
++deg[v1]; ++deg[v2];
}
for (int i = 0; i < n; ++i) s.insert({ deg[i], i });
bool erased_first, erased_second; erased_first = erased_second = true;
int cur;
ans = n;
while ((erased_first || erased_second) && !s.empty()) {
erased_first = false; erased_second = false;
cur = s.begin()->second;
if (deg[cur] < a || ans - (deg[cur] + 1) < b) {
s.erase(s.begin()); --ans; inset[cur] = false;
for (auto adj : adj_list[cur])
if (inset[adj]) {
s.erase({ deg[adj], adj });
--deg[adj];
s.insert({ deg[adj], adj });
}
erased_first = true;
}
if (!s.empty()) {
cur = prev(s.end())->second;
if (deg[cur] < a || ans - (deg[cur] + 1) < b) {
s.erase(prev(s.end())); --ans; inset[cur] = false;
for (auto adj : adj_list[cur])
if (inset[adj]) {
s.erase({ deg[adj], adj });
--deg[adj];
s.insert({ deg[adj], adj });
}
erased_second = true;
}
}
}
cout << ans << '\n';
return 0;
}
|
#ifndef HELPER_H
#define HELPER_H
#include <string>
std::string exec(const char* cmd);
#endif // HELPER_H
|
#include <iostream>
#include <vector>
#include <queue>
#include <future>
#include <assert.h>
#include <cstdlib>
#include "separate.h"
#include "private_queue.h"
#include "processor.h"
std::vector <processor*> g_processors;
int max_iters = 5000;
class producer {
public:
separate <int> *m_var;
private_queue <int> m_private_queue;
producer (separate <int> *var) :
m_private_queue (var->make_queue())
{
m_var = var;
}
void live() {
for (int i = 0; i < max_iters; i++) {
// std::cout << "producer run: " << i << std::endl;
run ();
}
std::cout << "done producing" << std::endl;
}
void run() {
processor *p = &m_var->m_proc;
bool wait_cond;
// Lock the processor and check the wait-condition.
// auto l_queue = m_queue->lock();
m_var->lock_with (m_private_queue);
std::function <bool(int *)> wait_func = [](int *x) {
return *x % 2 == 1;
};
// auto fut = l_queue.log_call_with_result (wait_func);
wait_cond = m_private_queue.log_call_with_result (wait_func);
// If the wait-condition isn't satisfied, wait and recheck
// when we're woken up (by another thread).
while (!wait_cond) {
// l_queue.unlock();
m_private_queue.unlock();
p->wait_until_available();
// l_queue = m_queue->lock();
m_var->lock_with (m_private_queue);
// auto fut = l_queue.log_call_with_result (wait_func);
wait_cond = m_private_queue.log_call_with_result (wait_func);
}
// log the call with result.
std::function<void(int *)> f = [](int *x) {
(*x)++;
};
// std::future <int> res = l_queue.log_call_with_result (f);
m_private_queue.log_call (f);
// end the queue
// l_queue.unlock();
m_private_queue.unlock ();
}
};
class consumer {
public:
separate <int> *m_var;
private_queue <int> m_private_queue;
consumer (separate <int>* var):
m_private_queue (var->make_queue())
{
m_var = var;
}
void live() {
for (int i = 0; i < max_iters; i++) {
// std::cout << "consumer run " << i << std::endl;
run ();
}
std::cout << "done consuming" << std::endl;
}
void run() {
processor *p = &m_var->m_proc;
bool wait_cond;
// Lock the processor and check the wait-condition.
// auto l_queue = m_queue->lock();
m_var->lock_with (m_private_queue);
std::function <bool(int *)> wait_func = [](int *x) {
return *x % 2 == 0;
};
// auto fut = l_queue.log_call_with_result (wait_func);
wait_cond = m_private_queue.log_call_with_result (wait_func);
// If the wait-condition isn't satisfied, wait and recheck
// when we're woken up (by another thread).
while (!wait_cond) {
// l_queue.unlock();
m_private_queue.unlock();
p->wait_until_available();
// l_queue = m_queue->lock();
m_var->lock_with (m_private_queue);
// auto fut = l_queue.log_call_with_result (wait_func);
wait_cond = m_private_queue.log_call_with_result (wait_func);
}
// log the call with result.
std::function<void(int *)> f = [](int *x) {
(*x)++;
};
// std::future <int> res = l_queue.log_call_with_result (f);
m_private_queue.log_call (f);
// end the queue
// l_queue.unlock();
m_private_queue.unlock ();
}
};
int main (int argc, char** argv) {
max_iters = atoi(argv[1]);
auto max_each = atoi(argv[2]);
std::vector <std::future <bool> > workers;
int *x = new int;
*x = 0;
separate <int> var (x);
g_processors.push_back (&var.m_proc);
for (int i = 0; i < max_each; i++) {
workers.push_back
(std::async
(std::launch::async,
[&var]() {
producer p (&var);
p.live();
return true;
}));
workers.push_back
(std::async
(std::launch::async,
[&var]() {
consumer p (&var);
p.live();
return true;
}));
}
for (auto& worker : workers) {
worker.get();
}
// example of final shutdown, this should be done by the GC in a real
// implementation.
for (auto& proc : g_processors) {
proc->shutdown ();
proc->join();
}
std::cout << *x << std::endl;
return 0;
}
|
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/video.hpp>
using namespace cv;
using namespace std;
int main() {
// 最多顯示小數後兩位
cout << fixed << setprecision(2);
String videoFile = "..\\..\\..\\test_data\\mog2_test.mp4";
VideoCapture capture(videoFile);
// 宣告MOG2演算法
Ptr<BackgroundSubtractor> pMOG2;
Mat frame;
Mat fgMaskMOG2;
// 高斯模糊大小
int blurSize = 17;
// 二值化閥值
int threhold = 81;
// 移動面積比率
double subRatio = 0.02;
// 背景模型學習速率
double learningRate = -1;
// 建立演算法, 設定參數
pMOG2 = createBackgroundSubtractorMOG2(500, 128, true);
if (!capture.isOpened()) {
cout << "Unable to open cpature " << endl;
exit(EXIT_FAILURE);
}
while (true) {
// 將目前偵數存入frame
if (!capture.read(frame)) {
cout << "Unable to read next frame." << endl;
exit(EXIT_FAILURE);
}
imshow("Frame", frame);
// 透過MOG2運算, 將結果存入fgMaskMOG2
pMOG2->apply(frame, fgMaskMOG2, learningRate);
imshow("FG Mask MOG 2", fgMaskMOG2);
// 高斯模糊
GaussianBlur(fgMaskMOG2.clone(), fgMaskMOG2, Size(blurSize, blurSize), 0, 0);
imshow("After blur", fgMaskMOG2);
double count = 0;
uchar *p;
// 二值化運算, 計算移動像素
for (int i = 0; i < fgMaskMOG2.rows; i++) {
p = fgMaskMOG2.ptr<uchar>(i);
for (int j = 0; j < fgMaskMOG2.cols; j++) {
if (p[j] > threhold) {
p[j] = 255;
count++;
}
else {
p[j] = 0;
}
}
}
imshow("Result", fgMaskMOG2);
// 計算移動比率
double currRatio = count / (fgMaskMOG2.rows * fgMaskMOG2.cols);
if (currRatio > subRatio) {
cout << "目前移動比率 : " << currRatio * 100 << "%" << endl;
}
waitKey(30);
}
capture.release();
return 0;
}
|
#pragma once
#include <distant/support/winapi/psapi.hpp>
#include <distant/types.hpp>
namespace distant::system
{
class performance_info
{
public:
performance_info();
/// @brief The number of pages currently committed by the system.
uint commited_pages() const;
/// @brief The current maximum number of pages that can be committed by the system without extending the paging file(s).
uint page_limit() const;
/// @brief The maximum number of pages that were simultaneously in the committed state since the last system reboot.
uint page_peak() const;
/// @brief The amount of actual physical memory, in pages.
uint total_physical_memory() const;
/// @brief The amount of physical memory currently available, in pages.
/// @brief This is the amount of physical memory that can be immediately reused without having to write its contents to disk first.
/// @brief It is the sum of the size of the standby, free, and zero lists.
uint available_physical_memory() const;
/// @brief The amount of system cache memory, in pages. This is the size of the standby list plus the system working set.
uint system_cache_size() const;
/// @brief The sum of the memory currently in the paged and nonpaged kernel pools, in pages.
uint total_kernel_memory() const;
/// @brief The memory currently in the paged kernel pool, in pages.
uint paged_kernel_memory() const;
/// @brief The memory currently in the nonpaged kernel pool, in pages.
uint nonpaged_kernel_memory() const;
/// @brief The size of a page, in bytes.
uint page_size() const;
/// @brief The current number of open handles.
uint handle_count() const;
/// @brief The current number of processes.
uint process_count() const;
/// @brief The current number of threads.
uint thread_count() const;
private:
boost::winapi::PERFORMANCE_INFORMATION_ info_;
};
}
// impl:
#include "impl/performance_info.hxx"
|
#ifndef UTENTEEXECUTIVE_H
#define UTENTEEXECUTIVE_H
#include "utente.h"
class UtenteExecutive : public Utente{
public:
//qui ci sarà l'overriding della funzione di ricerca
UtenteExecutive(Username, Info);
virtual vector<string> userSearch(const DB&, string);
};
#endif // UTENTEEXECUTIVE_H
|
//**************************************************************************
//**
//** See jlquake.txt for copyright info.
//**
//** 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 3
//** 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
//** included (gnu.txt) GNU General Public License for more details.
//**
//**************************************************************************
#include "../particles.h"
#include "../../client_main.h"
#include "../../../common/common_defs.h"
int q1ramp1[ 8 ] = { 0x6f, 0x6d, 0x6b, 0x69, 0x67, 0x65, 0x63, 0x61 };
int q1ramp2[ 8 ] = { 0x6f, 0x6e, 0x6d, 0x6c, 0x6b, 0x6a, 0x68, 0x66 };
int q1ramp3[ 8 ] = { 0x6d, 0x6b, 6, 5, 4, 3 };
void CLQ1_ParticleExplosion( const vec3_t origin ) {
for ( int i = 0; i < 1024; i++ ) {
cparticle_t* p = CL_AllocParticle();
if ( !p ) {
return;
}
p->die = cl.serverTime + 5000;
p->color = q1ramp1[ 0 ];
p->ramp = rand() & 3;
p->type = i & 1 ? pt_q1explode : pt_q1explode2;
for ( int j = 0; j < 3; j++ ) {
p->org[ j ] = origin[ j ] + ( ( rand() % 32 ) - 16 );
p->vel[ j ] = ( rand() % 512 ) - 256;
}
}
}
void CLQ1_BlobExplosion( const vec3_t origin ) {
for ( int i = 0; i < 1024; i++ ) {
cparticle_t* p = CL_AllocParticle();
if ( !p ) {
return;
}
p->die = cl.serverTime + 1000 + ( rand() & 8 ) * 50;
if ( i & 1 ) {
p->type = pt_q1blob;
p->color = 66 + rand() % 6;
} else {
p->type = pt_q1blob2;
p->color = 150 + rand() % 6;
}
for ( int j = 0; j < 3; j++ ) {
p->org[ j ] = origin[ j ] + ( ( rand() % 32 ) - 16 );
p->vel[ j ] = ( rand() % 512 ) - 256;
}
}
}
// Not present in QuakeWorld
void CLQ1_ParticleExplosion2( const vec3_t origin, int colorStart, int colorLength ) {
int colorMod = 0;
for ( int i = 0; i < 512; i++ ) {
cparticle_t* p = CL_AllocParticle();
if ( !p ) {
return;
}
p->die = cl.serverTime + 300;
p->color = colorStart + ( colorMod % colorLength );
colorMod++;
p->type = pt_q1blob;
for ( int j = 0; j < 3; j++ ) {
p->org[ j ] = origin[ j ] + ( ( rand() % 32 ) - 16 );
p->vel[ j ] = ( rand() % 512 ) - 256;
}
}
}
static void RunParticleEffect( const vec3_t origin, const vec3_t direction, int colour, int count, int scale, ptype_t type ) {
for ( int i = 0; i < count; i++ ) {
cparticle_t* p = CL_AllocParticle();
if ( !p ) {
return;
}
p->die = cl.serverTime + 100 * ( rand() % 5 );
p->color = ( colour & ~7 ) + ( rand() & 7 );
p->type = type;
for ( int j = 0; j < 3; j++ ) {
p->org[ j ] = origin[ j ] + scale * ( ( rand() & 15 ) - 8 );
p->vel[ j ] = direction[ j ] * 15;
}
}
}
void CLQ1_RunParticleEffect( const vec3_t origin, const vec3_t direction, int colour, int count ) {
if ( !( GGameType & GAME_QuakeWorld ) ) {
RunParticleEffect( origin, direction, colour, count, 1, pt_q1slowgrav );
} else {
if ( count > 130 ) {
RunParticleEffect( origin, direction, colour, count, 3, pt_q1grav );
} else if ( count > 20 ) {
RunParticleEffect( origin, direction, colour, count, 2, pt_q1grav );
} else {
RunParticleEffect( origin, direction, colour, count, 1, pt_q1grav );
}
}
}
void CLQ1_LavaSplash( const vec3_t origin ) {
for ( int i = -16; i < 16; i++ ) {
for ( int j = -16; j < 16; j++ ) {
for ( int k = 0; k < 1; k++ ) {
cparticle_t* p = CL_AllocParticle();
if ( !p ) {
return;
}
p->die = cl.serverTime + 2000 + ( rand() & 31 ) * 20;
p->color = 224 + ( rand() & 7 );
p->type = GGameType & GAME_QuakeWorld ? pt_q1grav : pt_q1slowgrav;
vec3_t dir;
dir[ 0 ] = j * 8 + ( rand() & 7 );
dir[ 1 ] = i * 8 + ( rand() & 7 );
dir[ 2 ] = 256;
p->org[ 0 ] = origin[ 0 ] + dir[ 0 ];
p->org[ 1 ] = origin[ 1 ] + dir[ 1 ];
p->org[ 2 ] = origin[ 2 ] + ( rand() & 63 );
VectorNormalize( dir );
float vel = 50 + ( rand() & 63 );
VectorScale( dir, vel, p->vel );
}
}
}
}
void CLQ1_TeleportSplash( const vec3_t origin ) {
for ( int i = -16; i < 16; i += 4 ) {
for ( int j = -16; j < 16; j += 4 ) {
for ( int k = -24; k < 32; k += 4 ) {
cparticle_t* p = CL_AllocParticle();
if ( !p ) {
return;
}
p->die = cl.serverTime + 200 + ( rand() & 7 ) * 20;
p->color = 7 + ( rand() & 7 );
p->type = GGameType & GAME_QuakeWorld ? pt_q1grav : pt_q1slowgrav;
vec3_t dir;
dir[ 0 ] = j * 8;
dir[ 1 ] = i * 8;
dir[ 2 ] = k * 8;
p->org[ 0 ] = origin[ 0 ] + i + ( rand() & 3 );
p->org[ 1 ] = origin[ 1 ] + j + ( rand() & 3 );
p->org[ 2 ] = origin[ 2 ] + k + ( rand() & 3 );
VectorNormalize( dir );
float vel = 50 + ( rand() & 63 );
VectorScale( dir, vel, p->vel );
}
}
}
}
// Not present in QuakeWorld
void CLQ1_BrightFieldParticles( const vec3_t origin ) {
float dist = 64;
float beamlength = 16;
if ( !avelocities[ 0 ][ 0 ] ) {
for ( int i = 0; i < NUMVERTEXNORMALS * 3; i++ ) {
avelocities[ 0 ][ i ] = ( rand() & 255 ) * 0.01;
}
}
for ( int i = 0; i < NUMVERTEXNORMALS; i++ ) {
float angle = cl.serverTime * avelocities[ i ][ 0 ] / 1000.0;
float sy = sin( angle );
float cy = cos( angle );
angle = cl.serverTime * avelocities[ i ][ 1 ] / 1000.0;
float sp = sin( angle );
float cp = cos( angle );
vec3_t forward;
forward[ 0 ] = cp * cy;
forward[ 1 ] = cp * sy;
forward[ 2 ] = -sp;
cparticle_t* p = CL_AllocParticle();
if ( !p ) {
return;
}
p->die = cl.serverTime + 10;
p->color = 0x6f;
p->type = pt_q1explode;
p->org[ 0 ] = origin[ 0 ] + bytedirs[ i ][ 0 ] * dist + forward[ 0 ] * beamlength;
p->org[ 1 ] = origin[ 1 ] + bytedirs[ i ][ 1 ] * dist + forward[ 1 ] * beamlength;
p->org[ 2 ] = origin[ 2 ] + bytedirs[ i ][ 2 ] * dist + forward[ 2 ] * beamlength;
}
}
void CLQ1_TrailParticles( vec3_t start, const vec3_t end, int type ) {
vec3_t vec;
float len;
int j;
cparticle_t* p;
static int tracercount;
VectorSubtract( end, start, vec );
len = VectorNormalize( vec );
while ( len > 0 ) {
len -= 3;
p = CL_AllocParticle();
if ( !p ) {
return;
}
VectorCopy( oldvec3_origin, p->vel );
p->die = cl.serverTime + 2000;
switch ( type ) {
case 0: // rocket trail
p->ramp = ( rand() & 3 );
p->color = q1ramp3[ ( int )p->ramp ];
p->type = pt_q1fire;
for ( j = 0; j < 3; j++ )
p->org[ j ] = start[ j ] + ( ( rand() % 6 ) - 3 );
break;
case 1: // smoke smoke
p->ramp = ( rand() & 3 ) + 2;
p->color = q1ramp3[ ( int )p->ramp ];
p->type = pt_q1fire;
for ( j = 0; j < 3; j++ )
p->org[ j ] = start[ j ] + ( ( rand() % 6 ) - 3 );
break;
case 2: // blood
p->type = GGameType & GAME_QuakeWorld ? pt_q1slowgrav : pt_q1grav;
p->color = 67 + ( rand() & 3 );
for ( j = 0; j < 3; j++ )
p->org[ j ] = start[ j ] + ( ( rand() % 6 ) - 3 );
break;
case 3:
case 5: // tracer
p->die = cl.serverTime + 500;
p->type = pt_q1static;
if ( type == 3 ) {
p->color = 52 + ( ( tracercount & 4 ) << 1 );
} else {
p->color = 230 + ( ( tracercount & 4 ) << 1 );
}
tracercount++;
VectorCopy( start, p->org );
if ( tracercount & 1 ) {
p->vel[ 0 ] = 30 * vec[ 1 ];
p->vel[ 1 ] = 30 * -vec[ 0 ];
} else {
p->vel[ 0 ] = 30 * -vec[ 1 ];
p->vel[ 1 ] = 30 * vec[ 0 ];
}
break;
case 4: // slight blood
p->type = GGameType & GAME_QuakeWorld ? pt_q1slowgrav : pt_q1grav;
p->color = 67 + ( rand() & 3 );
for ( j = 0; j < 3; j++ )
p->org[ j ] = start[ j ] + ( ( rand() % 6 ) - 3 );
len -= 3;
break;
case 6: // voor trail
p->color = 9 * 16 + 8 + ( rand() & 3 );
p->type = pt_q1static;
p->die = cl.serverTime + 300;
for ( j = 0; j < 3; j++ )
p->org[ j ] = start[ j ] + ( ( rand() & 15 ) - 8 );
break;
}
VectorAdd( start, vec, start );
}
}
|
#include <bits/stdc++.h>
#define MAX 100001
#define M 1000000007
#define ll long long
#define ld long double
#define ESP 0.0001
using namespace std;
ll mat[2][2], org[2][2];
ll a, d, r, n, m;
int matPow(int x) {
if (!x) return 0;
if (x&1) {
matPow(x-1);
ll temp[2][2];
temp[0][0] = ((mat[0][0]*org[0][0])%m + (mat[0][1]*org[1][0])%m)%m;
temp[0][1] = ((mat[0][0]*org[0][1])%m + (mat[0][1]*org[1][1])%m)%m;
temp[1][0] = ((mat[1][0]*org[0][0])%m + (mat[1][1]*org[1][0])%m)%m;
temp[1][1] = ((mat[1][0]*org[0][1])%m + (mat[1][1]*org[1][1])%m)%m;
for (int i=0;i<2;i++) {
for (int j=0;j<2;j++) {
mat[i][j] = temp[i][j];
}
}
return 0;
}
else {
matPow(x/2);
ll temp[2][2];
temp[0][0] = ((mat[0][0]*mat[0][0])%m + (mat[0][1]*mat[1][0])%m)%m;
temp[0][1] = ((mat[0][0]*mat[0][1])%m + (mat[0][1]*mat[1][1])%m)%m;
temp[1][0] = ((mat[1][0]*mat[0][0])%m + (mat[1][1]*mat[1][0])%m)%m;
temp[1][1] = ((mat[1][0]*mat[0][1])%m + (mat[1][1]*mat[1][1])%m)%m;
for (int i=0;i<2;i++) {
for (int j=0;j<2;j++) {
mat[i][j] = temp[i][j];
}
}
return 0;
}
}
int main() {
int t;
cin >> t;
while(t--) {
cin >> a >> d >> r >> n >> m;
org[0][0] = r;
org[0][1] = org[1][1] = 1;
org[1][0] = 0;
mat[0][0] = mat[1][1] = 1;
mat[1][0] = mat[0][1] = 0;
ll res;
if (n%2==0) {
matPow(n/2-1);
res = ((mat[0][0]*(a+d))%m + (mat[0][1]*d)%m)%m;
}
else {
matPow(n/2);
res = ((mat[0][0]*(a+d))%m + (mat[0][1]*d)%m)%m;
res = (res-d)%m;
if (res<0) res+=m;
}
cout << res << endl;
}
return 0;
}
|
#pragma once
class Int2
{
public:
Int2();
Int2(const int _x, const int _y);
int x;
int y;
};
|
#include <iostream>
#include <climits>
using namespace std;
int main()
{
int n;
cin >> n;
int arr[n];
for (int i = 0; i < n; i++)
{
cin >> arr[i];
}
int maxNo = arr[0];
int minNo = arr[0];
for (int i = 0; i < n; i++)
{
if (arr[i] > maxNo)
{
maxNo = arr[i];
}
else if (arr[i] < minNo)
{
minNo = arr[i];
}
}
cout << maxNo << " " << minNo;
return 0;
}
|
/*
* This program is illustrate operator overloading of Binary operators.
* Program of vector is created to illustrate it and get the sum of it.
*/
#include <iostream> // Header
using namespace std;
class Vector{ // Vector class
public:
void set(int x,int y){ // set function.
real=x;
img=y;
}
void print(){ // print function.
cout<<"("<<real<<","<<img<<")"<<endl;
}
Vector operator+(Vector V){ // Binary operator overloading, It will return sum of 2 vectors.
Vector temp; // Creating temp Vector to return the sum of given 2 vectors.
temp.real=real+V.real; // assigning sum of variable to temp variable.
temp.img=img+V.img;
return temp; // Returning sum of 2 objects which is stored in temp.
}
private:
int real,img; // Declaring variable members.
};
int main(){
Vector V1,V2,ANS; // Creating 3 Vector type objects.
V1.set(2,5); // Set vector1.
V2.set(5,7); // Set vector2.
cout<<"Value of Vector1 : "; V1.print(); // printing Vectors.
cout<<"Value of Vector2 : "; V2.print();
ANS=V1+V2; // using operator overloading to get sum of V1 and V2.
// You can also use "ANS=V1.operator+(V2)"
cout<<endl<<"ANS Vector is : "; ANS.print(); // printing answer.
return 0;
}
|
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cmath>
#include <cstdlib>
#include <complex>
#include <vector>
using std::cout;
using std::endl;
using std::ofstream;
using std::ifstream;
using std::complex;
using std::vector;
#include "include.h"
int main(int argc,char *argv[]){
cout.precision(15);
int L = atoi(argv[1]);
int Nw = atoi(argv[2]);
double f = atof(argv[3]);
//initialize the dimensions of the problem, set the trial
global::init(L,L,f);
VMC vmc(Nw);
vmc.walk(5000);
char filename[200];
sprintf(filename,"output/%dx%d/f=%f.walk",L,L,global::f);
vmc.dump(filename);
}
|
#ifndef ARTICLE_H
#define ARTICLE_H
#include "note.h"
class NotesManager;
/*!
* \file article.h
* \brief Classe de base permettant de définir une note de type article
* \author Pauline Cuche/Simon Robain
*/
/**
*\class Article
* \brief Classe représentant les Articles
*/
class Article : public Note {
QString texte; /*!< Texte de l'article*/
Article(const Article& a);
Article& operator=(const Article& a);
public:
/*!
* \brief Constructeur Par Defaut
*
* Constructeur par défaut de la classe Article
*/
Article();
/*!
* \brief Constructeur
*
* Constructeur de la classe Article
*\param id : ID de l'Article
*\param titre : titre de l'Article
*\param texte : texte de l'Article (vide par défaut)
*/
Article(const QString& id, const QString& titre, const QString& text="");
/*!
* \brief Accesseur de l'attribut texte
*\return texte : texte de l'Article
*/
QString getTexte() const {return texte;}
/*!
* \brief Setteur de l'attribut texte
*\param texte : texte que l'on souhaite rentrer dans l'Article
*/
void setTexte(const QString& t);
/*!
* \brief Sauvegarde d'un Article
*Methode qui permet la sauvegarde d'un Article
*\param directory : chemin d'accès à l'espace de travail
*/
void save(const QString& directory);
/*!
* \brief Accesseur du type de la note (ici ARTICLE)
*\return NoteType : type de la note renvoyée
*/
NoteType getType() const;
};
#endif // ARTICLE_H
|
#pragma once
#include "Card.h"
class KerkhofCard :
public Card
{
public:
KerkhofCard();
static std::unique_ptr<Card> __stdcall Create();
~KerkhofCard();
};
|
#ifndef _GAME_MODELS_H_
#define _GAME_MODELS_S_
#include "../../../Dependencies/glew/glew.h"
#include "../../../Dependencies/freeglut/freeglut.h"
#include "../Vertex_Format/Vertex_Format.hpp"
#include <vector>
#include <map>
namespace Models
{
struct Model
{
unsigned int vao;
std::vector<unsigned int> vbos;
Model();
};
class GameModels
{
private:
// Our models
std::map<std::string, Model> gameModelList;
public:
GameModels();
~GameModels();
void createTriangleModel(const std::string & gameModelName);
void deleteModel(const std::string & gameModelName);
unsigned int getModel(const std::string gameModelName);
};
}
#endif // !_GAME_MODELS_H_
|
#include "externals.h"
#include "typedValue.h"
#include "stack.h"
#include "word.h"
#include "context.h"
void InitDict_Array() {
// (n -- array)
// n new-array
Install(new Word("new-array",WORD_FUNC {
if(inContext.DS.size()<1) { return inContext.Error(E_DS_IS_EMPTY); }
TypedValue tvArraySize=Pop(inContext.DS);
if(tvArraySize.dataType!=kTypeInt) {
return inContext.Error_InvalidType(E_TOS_INT,tvArraySize);
}
const int n=tvArraySize.intValue;
if(n<=0) { return inContext.Error(E_TOS_POSITIVE_INT,n); }
TypedValue *dataBody=new TypedValue[n];
Array<TypedValue> *arrayPtr=new Array<TypedValue>(n,dataBody,true);
inContext.DS.emplace_back(arrayPtr);
NEXT;
}));
// sizeOfArray initValue -- array
Install(new Word("new-array-with",WORD_FUNC {
if(inContext.DS.size()<2) { return inContext.Error(E_DS_AT_LEAST_2); }
TypedValue tvInitValue=Pop(inContext.DS);
TypedValue tvSize=Pop(inContext.DS);
if(tvSize.dataType!=kTypeInt) {
return inContext.Error_InvalidType(E_SECOND_INT,tvSize);
}
const int n=tvSize.intValue;
if(n<=0) { return inContext.Error(E_SECOND_POSITIVE_INT,n); }
TypedValue *dataBody=new TypedValue[n];
for(int i=0; i<n; i++) {
dataBody[i]=tvInitValue;
}
Array<TypedValue> *arrayPtr=new Array<TypedValue>(n,dataBody,true);
inContext.DS.emplace_back(arrayPtr);
NEXT;
}));
// (array index value -- array) <- this operation is thread-safe.
// or
// (list index value -- list)
//
// effect: array[index]=value
// list[index]=value
Install(new Word("set",WORD_FUNC {
if(inContext.DS.size()<3) { return inContext.Error(E_DS_AT_LEAST_3); }
TypedValue tvValue=Pop(inContext.DS);
TypedValue tvIndex=Pop(inContext.DS);
if(tvIndex.dataType!=kTypeInt) {
return inContext.Error_InvalidType(E_SECOND_INT,tvIndex);
}
const int index=tvIndex.intValue;
TypedValue& tvTarget=ReadTOS(inContext.DS);
if(tvTarget.dataType==kTypeArray) {
// is index in [0,tvTarget.arrayPtr->length) ?
if((unsigned int)(tvTarget.arrayPtr->length)<=(unsigned int)index) {
return inContext.Error(E_ARRAY_INDEX_OUT_OF_RANGE,
tvTarget.arrayPtr->length-1,index);
}
Lock(tvTarget.arrayPtr->mutex);
tvTarget.arrayPtr->data[index]=tvValue;
Unlock(tvTarget.arrayPtr->mutex);
} else if(tvTarget.dataType==kTypeList) {
// is index in [0,tvTarget.listPtr->size()) ?
if((unsigned int)(tvTarget.listPtr->size())<=(unsigned int)index) {
return inContext.Error(E_LIST_INDEX_OUT_OF_RANGE,
(int)tvTarget.listPtr->size()-1,index);
}
tvTarget.listPtr->at(index)=tvValue;
} else {
return inContext.Error_InvalidType(E_THIRD_ARRAY_OR_LIST,tvTarget);
}
NEXT;
}));
// array index --- array value [ <- this operation is thread-safe. ]
// or
// list index --- list value
// get array[index]
Install(new Word("get",WORD_FUNC {
if(inContext.DS.size()<2) { return inContext.Error(E_DS_AT_LEAST_2); }
TypedValue tvIndex=Pop(inContext.DS);
if(tvIndex.dataType!=kTypeInt) {
return inContext.Error_InvalidType(E_TOS_INT,tvIndex);
}
const int index=tvIndex.intValue;
TypedValue& tvTarget=ReadTOS(inContext.DS);
if(tvTarget.dataType==kTypeArray) {
// is index in [0,tvTarget.arrayPtr->length) ?
if((unsigned int)(tvTarget.arrayPtr->length)<=(unsigned int)index) {
return inContext.Error(E_ARRAY_INDEX_OUT_OF_RANGE,
tvTarget.arrayPtr->length-1,index);
}
Lock(tvTarget.arrayPtr->mutex);
inContext.DS.emplace_back(tvTarget.arrayPtr->data[index]);
Unlock(tvTarget.arrayPtr->mutex);
} else if(tvTarget.dataType==kTypeList) {
// is index in [0,tvTarget.listPtr->size()) ?
if((unsigned int)(tvTarget.listPtr->size())<=(unsigned int)index) {
return inContext.Error(E_LIST_INDEX_OUT_OF_RANGE,
(int)tvTarget.listPtr->size()-1,index);
}
inContext.DS.emplace_back(tvTarget.listPtr->at(index));
} else {
return inContext.Error_InvalidType(E_SECOND_ARRAY,tvTarget);
}
NEXT;
}));
// (array -- array n)
Install(new Word("size",WORD_FUNC {
if(inContext.DS.size()<1) { return inContext.Error(E_DS_IS_EMPTY); }
TypedValue& tos=ReadTOS(inContext.DS);
if(tos.dataType==kTypeArray) {
inContext.DS.emplace_back(tos.arrayPtr->length);
} else if(tos.dataType==kTypeList) {
inContext.DS.emplace_back((int)tos.listPtr->size());
} else {
return inContext.Error_InvalidType(E_TOS_ARRAY,tos);
}
NEXT;
}));
// array index --- array index t/f
// or
// list index --- list index t/f
Install(new Word("valid-index?",WORD_FUNC {
if(inContext.DS.size()<2) { return inContext.Error(E_DS_AT_LEAST_2); }
TypedValue& tvIndex=ReadTOS(inContext.DS);
if(tvIndex.dataType!=kTypeInt) {
return inContext.Error_InvalidType(E_TOS_INT,tvIndex);
}
TypedValue& tvTarget=ReadSecond(inContext.DS,"DS");
bool result;
if(tvTarget.dataType==kTypeArray) {
// is index in [0,tvTarget.arrayPtr->length) ?
result=(unsigned int)(tvTarget.arrayPtr->length)
>(unsigned int)(tvIndex.intValue);
} else if(tvTarget.dataType==kTypeList) {
// is index in [0,tvTarget.listPtr->length) ?
result=(unsigned int)(tvTarget.listPtr->size())
>(unsigned int)(tvIndex.intValue);
} else {
return inContext.Error_InvalidType(E_SECOND_ARRAY_OR_LIST,tvTarget);
}
inContext.DS.emplace_back(result);
NEXT;
}));
}
|
/*#include "TesteController.h"
#include "Controller.h"
#include <assert.h>
bool TesteController::logIn() {
Controller* c1 = new Controller();
assert(logIn == 0);
}
*/
/*
void TesteController::geSize_isNotSet() {
Controller* c1 = new Controller();
int size = c1->getSize();
assert(size != 5);
}
void TesteController::getLength_isSet() {
Controller* c1 = new Controller();
int length = c1->getLength();
assert(length == 10);
}
void TesteController::getLength_isNotSet() {
Controller* c1 = new Controller();
int length = c1->getLength();
assert(length != 15);
}
*/
//void TesteController::run() {
|
/*
* t_PID.cpp
*
* Created on: Feb 28, 2016
* Author: alexander
*/
|
// Copyright [2015] <lgb (LiuGuangBao)>
//=====================================================================================
//
// Filename: file.cpp
//
// Description: 文件上传
//
// Version: 1.0
// Created: 2015年07月31日 09时22分27秒
// Revision: none
// Compiler: gcc
//
// Author: lgb (LiuGuangBao), easyeagel@gmx.com
// Organization: ezbty.org
//
//=====================================================================================
//
#include<core/http/file.hpp>
namespace core
{
void HttpFile::mutipartBody(ErrorCode& ecRet, const HttpParser& hp, const Byte* bt, size_t nb)
{
if(times_==0)
{
if(boundary_.empty())
{
boundary_=MutilpartData::headCheck(ecRet, hp);
if(ecRet.bad())
return;
}
mutipart_.boundarySet(boundary_);
mutipart_.partCallSet([this](core::ErrorCode& ec, const MutilpartData::PartTrait& trait, const Byte* byte, size_t size)
{
mutipartCall(ec, trait, byte, size);
}
);
}
++times_;
mutipart_.parse(ecRet, bt, nb);
}
void HttpFile::mutipartCall(core::ErrorCode& , const MutilpartData::PartTrait& trait, const Byte* bt, size_t nb)
{
switch(trait.stat)
{
case core::MutilpartData::eStatusStart:
{
stream_.close();
streamOpen_(trait, stream_);
break;
}
default:
break;
}
if(bt && nb>0)
stream_.write(reinterpret_cast<const char*>(bt), nb);
}
SimpleFileDispatcher::SimpleFileDispatcher(const boost::filesystem::path& dir)
:dir_(dir)
{
fileDest_.streamOpenSet([this](const MutilpartData::PartTrait& , HttpFile::FileStream& stream)
{
char name[256];
std::sprintf(name, "iptop-%03u.pdf", fileIndex_++);
boost::filesystem::path path=dir_/name;
stream.open(path);
}
);
}
void SimpleFileDispatcher::headCompleteCall(ErrorCode& ec, const HttpParser& hp)
{
boundary_=MutilpartData::headCheck(ec, hp);
}
void SimpleFileDispatcher::bodyCall(ErrorCode& ec, const HttpParser& hp, const char* bt, size_t nb)
{
fileDest_.mutipartBody(ec, hp, reinterpret_cast<const Byte*>(bt), nb);
}
void SimpleFileDispatcher::bodyCompleteCall(const HttpParser& , ResponseCall&& call)
{
auto respones=std::make_shared<HttpResponse>(HttpResponse::eHttpOk);
respones->commonHeadInsert(HttpHead::eContentType, "application/json;charset=utf-8");
respones->commonHeadInsert(HttpHead::eConnection, "keep-alive");
respones->bodySet(R"JSON(
{
"status": "OK"
}
)JSON");
respones->cache();
call(ErrorCode(), std::move(respones));
}
}
|
#pragma once
#include <cstdint>
#if defined __ARM_FP16_FORMAT_IEEE && !defined __CUDACC__
#define CIL_FP16_TYPE 1
#else
#define CIL_FP16_TYPE 0
#endif
namespace cil {
union CIL16suf {
int16_t i;
uint16_t u;
#if CIL_FP16_TYPE
__fp16 h;
#endif
struct _fp16Format {
unsigned int significand : 10;
unsigned int exponent : 5;
unsigned int sign : 1;
} fmt;
};
union CIL32suf {
int32_t i;
uint32_t u;
float f;
struct _fp32Format {
unsigned int significand : 23;
unsigned int exponent : 8;
unsigned int sign : 1;
} fmt;
};
union CIL64suf {
int64_t i;
uint64_t u;
double f;
};
} // namespace cil
|
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int n,m;
int xi,yi;
int zi,wi;
//200*xi+3*yi;
bool p1[100000] = {false};
bool t1[100000] = {false};
struct node{
int z;
int w;
};
int max1 = 0;
node te;
vector<node > p;
vector<node > t;
int num = 0;
bool cmp(node a,node b){
if(a.z!=b.z)return a.z<b.z;
return a.w < b.w;
}
int func(int e){
if(e > max1)e = max1;
int num = 0;
for(int i = 0 ; i < n ; i++){
if(t1[i]==true)continue;
for(int j = 0 ; j < n ; j++){
if(p1[j]==true)continue;
if(p[j].z>=t[i].z&&p[j].w>=t[i].w){
p1[j]=true;
t1[i]=true;
int temp = func(e+1)+200*t[i].z+3*yi;
if(num<temp)num = temp;
t1[i]=false;
p1[j]=false;
}
}
}
return num;
}
int main(){
cin >> n >> m;
for(int i = 0 ; i < n ; i++){
cin >> te.z >> te.w;
p.push_back(te);
}
for(int i = 0 ; i < m ; i++){
cin >> te.z >> te.w;
t.push_back(te);
}
sort(p.begin(),p.end(),cmp);
sort(p.begin(),p.end(),cmp);
cout <<max1<<" "<< func(0);
return 0;
}
|
#ifndef WINDOW_H
#define WINDOW_H
#include <iostream>
#include "ui_window.h"
#include <QDialog>
#include <bits/stdc++.h>
#include "PlayRoom.h"
#include "CreepingGame.h"
#include "Ant.h"
#include "Stick.h"
#include <QPropertyAnimation>
#include <QSequentialAnimationGroup>
#include <QParallelAnimationGroup>
#include <QGraphicsOpacityEffect>
using namespace std;
namespace Ui {
class window;
}
class window : public QDialog
{
Q_OBJECT
public:
explicit window(QWidget *parent = nullptr);
~window();
int location[5]={0};
int length=0;
QParallelAnimationGroup *maxAnimationGroup;
QParallelAnimationGroup *minAnimationGroup;
QPropertyAnimation *maxanim[5];
QPropertyAnimation *minanim[5];
QPropertyAnimation *maxanimalpha[5];
QPropertyAnimation *minanimalpha[5];
QRadioButton *MaxAnts[5];
QRadioButton *MinAnts[5];
QGraphicsOpacityEffect *pSetMaxAntsOpacityToOne;
QGraphicsOpacityEffect *pSetMinAntsOpacityToOne;
private slots:
void on_Location1_valueChanged();
void on_Location2_valueChanged();
void on_Location3_valueChanged();
void on_Location4_valueChanged();
void on_Location5_valueChanged();
void on_Length_valueChanged();
void on_StartButtom_clicked();
void on_ResetButtom_clicked();
private:
Ui::window *ui;
};
#endif // WINDOW_H
|
/*
* BasicJob.h
*
* Created on: 2016年9月21日
* Author: genue
*/
#ifndef JOBTHREAD_H_
#define JOBTHREAD_H_
#include <pthread.h>
#include <iostream>
using namespace std;
enum JOB_EXIT_CODE
{
/**
* 正常退出,一般是break之后退出
* **/
JOB_NORMAL_EXIT,
/**
* 异常退出,一般是流断了之后退出
* **/
JOB_EXCEPTION_EXIT
};
class JobThread {
protected:
pthread_t threadHandle;
bool isBreak;
public:
bool dead;
protected:
static void * onThreadHandle(void *arg);
public:
void start();
void wait();
void finish();
virtual JOB_EXIT_CODE excute();
public:
JobThread();
virtual ~JobThread();
};
#endif /* JOBTHREAD_H_ */
|
#define _USE_MATH_DEFINES
#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main() {
long double A, B, H, M;
cin >> A >> B >> H >> M;
long double ratioH = (60.0 * H + M) / (12.0 * 60.0);
long double ratioM = M / 60.0;
long double diff = abs(ratioH - ratioM);
long double theta = diff * M_PI * 2.0;
long double C = sqrtl(A * A + B * B - 2.0 * A * B * cosl(theta));
cout << setprecision(10) << C;
}
|
#include <iostream>
#include<cmath>
using namespace std;
int main() {
// your code goes here
unsigned int tc;
cin>>tc;
while(tc--)
{
unsigned long long int start,end;
cin>>start>>end;
unsigned long long int x=ceil(sqrt(start));
unsigned long long int y=floor(sqrt(end));
cout<<(y-x)+1<<endl;
}
return 0;
}
|
// Devin Kim ddk3ev@virginia.edu
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <limits.h>
// Google implementations of union-find and work backwards from there
int parent[100005*2], cnt[100005*2], id[100005*2]; //we need to add a CNT and ID array to keep track
long long sum[100005*2];
int n_num, n_cmd, new_node; //we will use this new_node int to help with our moving
int find(int i)
{
if (parent[i] == i)
return i;
else
return parent[i] = find(parent[i]);
}
void merge(int p, int q)
{
int set_p = find(id[p]), set_q = find(id[q]);
if (set_p != set_q)
{
parent[set_p] = set_q;
cnt[set_q] += cnt[set_p];
sum[set_q] += sum[set_p];
}
}
void move(int p, int q) //we need this for operation 2
{
int set_p = find(id[p]);
sum[set_p] -= p;
cnt[set_p]--;
id[p] = ++new_node;
sum[id[p]] = p;
cnt[id[p]] = 1;
parent[id[p]] = id[p];
merge(p, q);
}
int main()
{
while(scanf("%d%d", &n_num, &n_cmd) != EOF)
{
//create tables
for (int i = 0; i <= n_num; i++)
{
id[i] = parent[i] = sum[i] = i;
cnt[i] = 1;
}
new_node = 100005 + 1;
//input
for (int i = 0; i < n_cmd; i++)
{
int op, p, q;
scanf("%d", &op);
if (op == 1)
{
scanf("%d%d", &p, &q);
merge(p, q);
}
else if (op == 2)
{
scanf("%d%d", &p, &q);
int set_p = find(id[p]), set_q = find(id[q]);
if (set_p != set_q){
move(p, q);
}
}
else if (op == 3)
{
scanf("%d", &p);
printf("%d %lld\n", cnt[find(id[p])], sum[find(id[p])]);
}
}
}
return 0;
}
|
/*----------------------------------------------------------------------------*
* ���ϸ� : sinItem.cpp
* �ϴ��� : ������ ����
* �ۼ��� : ����������Ʈ 12��
* ������ : �ڻ�
*-----------------------------------------------------------------------------*/
#include "sinLinkHeader.h"
#include "Language\\language.h"
/*----------------------------------------------------------------------------*
* ���� ����
*-----------------------------------------------------------------------------*/
cITEM cItem;
sITEM TempItem; //��� ����� ������ ����ü ����
sITEM MouseItem; //���콺�� �Ű��� ������
sITEMREQUIRE sRequire; //������ �䱸ġ �÷�
POINT ItemBoxPosi; //�ڽ� ��ġ
POINT ItemBoxSize; //�ڽ� ������
POINT TextSetPosi; //�ؽ�Ʈ�� ������ ��ǥ
char szInfoBuff[5000]; //�������� ������ ����ִ� ����
char szInfoBuff2[5000]; //�������� ���� ��ġ
int sinShowItemInfoFlag = 0; //������ ������ �����ش�
int tWeaponClass = 0;
int AgingGageFlag = 0;
int AgingBarLenght = 0;
DWORD sinItemTime = 0; //������ ����Ⱓ
/*----------------------------------------------------------------------------*
* �������� �������̽� ���ѱ���
*-----------------------------------------------------------------------------*/
int NotSell_Item_CODECnt = 0;
int NotSell_Item_MASKCnt = 0;
int NotSell_Item_KINDCnt = 0;
int NotDrow_Item_CODECnt = 0;
int NotDrow_Item_MASKCnt = 0;
int NotDrow_Item_KINDCnt = 0;
int NotSet_Item_CODECnt = 0;
int NotSet_Item_MASKCnt = 0;
int NotSet_Item_KINDCnt = 0;
DWORD NotSell_Item_CODE[] = {(sinQT1|sin07),(sinQT1|sin08),0 };
DWORD NotSell_Item_MASK[] = {0 };
DWORD NotSell_Item_KIND[] = {ITEM_KIND_QUEST_WEAPON,0 };
DWORD NotDrow_Item_CODE[] = {(sinQT1|sin07),(sinQT1|sin08),0 };
DWORD NotDrow_Item_MASK[] = {0};
DWORD NotDrow_Item_KIND[] = {ITEM_KIND_QUEST_WEAPON,0 };
DWORD NotSet_Item_CODE[] = {(sinQT1|sin07),(sinQT1|sin08),0 };
DWORD NotSet_Item_MASK[] = {0 };
DWORD NotSet_Item_KIND[] = {ITEM_KIND_QUEST_WEAPON,0 };
/*----------------------------------------------------------------------------*
* �����۱���ü�� ������ �ʱ�ȭ�Ѵ�
*-----------------------------------------------------------------------------*/
sITEM sItem[MAX_ITEM] = {
/*-------------------*
* ���� (Weapon)
*--------------------*/
//Axes A1
//*Code *Name *Category *Item size *Directory *Class *Drop����Items�� *Set location
{sinWA1|sin01 ,"Stone Axe" ,"WA101", ITEMSIZE*1, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WA101" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin02 ,"Steel Axe" ,"WA102", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WA102" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin03 ,"Battle Axe" ,"WA103", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WA103" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin04 ,"War Axe" ,"WA104", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WA104" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin05 ,"DoubleSidedWarAxe" ,"WA105", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WA105" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin06 ,"Bat Axe" ,"WA106", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WA106" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin07 ,"Mechanic Axe" ,"WA107", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WA107" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin08 ,"Double Head Axe" ,"WA108", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WA108" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin09 ,"Great Axe" ,"WA109", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WA109" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin10 ,"Diamond Axe" ,"WA110", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WA110" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin11 ,"Jagged Axe" ,"WA111", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WA111" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin12 ,"Cleaver" ,"WA112", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WA112" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin13 ,"Gigantifc Axe" ,"WA113", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WA113" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin14 ,"ChaosAxe" ,"WA114", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WA114" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWA1|sin15 ,"SinBaRam Axe" ,"WA115", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WA115" ,INVENTORY_POS_RHAND,SIN_SOUND_AXES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{ sinWA1 | sin16, "Fury Axe", "WA116", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WA116", INVENTORY_POS_RHAND, SIN_SOUND_AXES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWA1 | sin17, "Ancient Axe", "WA117", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WA117", INVENTORY_POS_RHAND, SIN_SOUND_AXES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWA1 | sin18, "Chaos Axe", "WA118", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WA118", INVENTORY_POS_RHAND, SIN_SOUND_AXES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWA1 | sin19, "Relic Axe", "WA119", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WA119", INVENTORY_POS_RHAND, SIN_SOUND_AXES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWA1 | sin20, "Minotaur Axe", "WA120", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WA120", INVENTORY_POS_RHAND, SIN_SOUND_AXES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWA1 | sin21, "Wyvern Axe", "WA121", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WA121", INVENTORY_POS_RHAND, SIN_SOUND_AXES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWA1 | sin22, "Zecram Axe", "WA122", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WA122", INVENTORY_POS_RHAND, SIN_SOUND_AXES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWA1 | sin23, "Dragon Axe", "WA123", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WA123", INVENTORY_POS_RHAND, SIN_SOUND_AXES, ITEM_WEAPONCLASS_NOT_SHOOTING },
//Claws C1
{sinWC1|sin01 ,"Eagle Claw" ,"WC101", ITEMSIZE*1, ITEMSIZE*2,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC101" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin02 ,"Tiger Claw" ,"WC102", ITEMSIZE*1, ITEMSIZE*2,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC102" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin03 ,"Griffin Claw" ,"WC103", ITEMSIZE*1, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC103" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin04 ,"Eagle Claw" ,"WC104", ITEMSIZE*1, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC104" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin05 ,"Eagle Claw" ,"WC105", ITEMSIZE*1, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC105" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin06 ,"Fingered Edge" ,"WC106", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC106" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin07 ,"Hand Blade" ,"WC107", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC107" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin08 ,"Pharaoh" ,"WC108", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC108" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin09 ,"Brutal Claw" ,"WC109", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC109" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin10 ,"Hydra Claw" ,"WC110", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC110" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin11 ,"Leviathan" ,"WC111", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC111" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin12 ,"Wyvern Claw" ,"WC112", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC112" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin13 ,"Chaos Claw" ,"WC113", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC113" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin14 ,"Titan Claw" ,"WC114", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC114" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWC1|sin15 ,"SinBaRam Claw" ,"WC115", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WC115" ,INVENTORY_POS_RHAND,SIN_SOUND_CLAWS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{ sinWC1 | sin16, "Titan Talon", "WC116", ITEMSIZE * 2, ITEMSIZE * 3, "Weapon", ITEM_CLASS_WEAPON_ONE, "WC116", INVENTORY_POS_RHAND, SIN_SOUND_CLAWS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWC1 | sin17, "Salamander Talon", "WC117", ITEMSIZE * 2, ITEMSIZE * 3, "Weapon", ITEM_CLASS_WEAPON_ONE, "WC117", INVENTORY_POS_RHAND, SIN_SOUND_CLAWS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWC1 | sin18, "Phoenix Talon", "WC118", ITEMSIZE * 2, ITEMSIZE * 3, "Weapon", ITEM_CLASS_WEAPON_ONE, "WC118", INVENTORY_POS_RHAND, SIN_SOUND_CLAWS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWC1 | sin19, "Chimera Talon", "WC119", ITEMSIZE * 2, ITEMSIZE * 3, "Weapon", ITEM_CLASS_WEAPON_ONE, "WC119", INVENTORY_POS_RHAND, SIN_SOUND_CLAWS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWC1 | sin20, "Extreme Talon", "WC120", ITEMSIZE * 2, ITEMSIZE * 3, "Weapon", ITEM_CLASS_WEAPON_ONE, "WC120", INVENTORY_POS_RHAND, SIN_SOUND_CLAWS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWC1 | sin21, "Viper Talon", "WC121", ITEMSIZE * 2, ITEMSIZE * 3, "Weapon", ITEM_CLASS_WEAPON_ONE, "WC121", INVENTORY_POS_RHAND, SIN_SOUND_CLAWS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWC1 | sin22, "Injustice Talon", "WC122", ITEMSIZE * 2, ITEMSIZE * 3, "Weapon", ITEM_CLASS_WEAPON_ONE, "WC122", INVENTORY_POS_RHAND, SIN_SOUND_CLAWS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWC1 | sin23, "Heretic Talon", "WC123", ITEMSIZE * 2, ITEMSIZE * 3, "Weapon", ITEM_CLASS_WEAPON_ONE, "WC123", INVENTORY_POS_RHAND, SIN_SOUND_CLAWS, ITEM_WEAPONCLASS_NOT_SHOOTING },
//Hammer & So On H1
{sinWH1|sin01 ,"Club" ,"WH101", ITEMSIZE*1, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WH101" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin02 ,"War Mac" ,"WH102", ITEMSIZE*1, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WH102" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin03 ,"Pole Mace" ,"WH103", ITEMSIZE*1, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WH103" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin04 ,"Gothic Mace" ,"WH104", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WH104" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin05 ,"War Hammer" ,"WH105", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WH105" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin06 ,"Metal Hammer" ,"WH106", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WH106" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin07 ,"Cross Hammer" ,"WH107", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WH107" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin08 ,"Holy Hammer" ,"WH108", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WH108" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin09 ,"Star" ,"WH109", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WH109" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin10 ,"Maximum" ,"WH110", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WH110" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin11 ,"Meditaition" ,"WH111", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WH111" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin12 ,"Rune Hammer" ,"WH112", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WH112" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin13 ,"Solar" ,"WH113", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WH113" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin14 ,"War Maul" ,"WH114", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WH114" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin15 ,"Titan Maul" ,"WH115", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WH115" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWH1|sin16 ,"SinBaRam Mace","WH116", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WH116" ,INVENTORY_POS_RHAND,SIN_SOUND_HAMMER,ITEM_WEAPONCLASS_NOT_SHOOTING},
{ sinWH1 | sin17, "Brutal Hammer", "WH117", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WH117", INVENTORY_POS_RHAND, SIN_SOUND_HAMMER, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWH1 | sin18, "Gladiator Hammer", "WH118", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WH118", INVENTORY_POS_RHAND, SIN_SOUND_HAMMER, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWH1 | sin19, "Archon Hammer", "WH119", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WH119", INVENTORY_POS_RHAND, SIN_SOUND_HAMMER, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWH1 | sin20, "Justice Hammer", "WH120", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WH120", INVENTORY_POS_RHAND, SIN_SOUND_HAMMER, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWH1 | sin21, "Dragon Bone Hammer", "WH121", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WH121", INVENTORY_POS_RHAND, SIN_SOUND_HAMMER, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWH1 | sin22, "Guardian Hammer", "WH122", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WH122", INVENTORY_POS_RHAND, SIN_SOUND_HAMMER, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWH1 | sin23, "Bane Hammer", "WH123", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WH123", INVENTORY_POS_RHAND, SIN_SOUND_HAMMER, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWH1 | sin24, "Dragon Hammer", "WH124", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WH124", INVENTORY_POS_RHAND, SIN_SOUND_HAMMER, ITEM_WEAPONCLASS_NOT_SHOOTING },
//Wand -_-;
{sinWM1|sin01 ,"Wand" ,"WM101", ITEMSIZE*1, ITEMSIZE*2,"Weapon",ITEM_CLASS_WEAPON_ONE,"WM101" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin02 ,"Sphere Wand" ,"WM102", ITEMSIZE*1, ITEMSIZE*2,"Weapon",ITEM_CLASS_WEAPON_ONE,"WM102" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin03 ,"Obi Wand" ,"WM103", ITEMSIZE*1, ITEMSIZE*2,"Weapon",ITEM_CLASS_WEAPON_ONE,"WM103" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin04 ,"Root Staff" ,"WM104", ITEMSIZE*1, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_TWO,"WM104" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin05 ,"Poly Staff" ,"WM105", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WM105" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin06 ,"Elven Wand" ,"WM106", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WM106" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin07 ,"Dryad Wand" ,"WM107", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WM107" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin08 ,"Meditaion Staff","WM108", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WM108" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin09 ,"Skull Staff" ,"WM109", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WM109" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin10 ,"Mage Staff" ,"WM110", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WM110" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin11 ,"Faith Wand" ,"WM111", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WM111" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin12 ,"Lofty Staff" ,"WM112", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WM112" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin13 ,"Arch Wand" ,"WM113", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WM113" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin14 ,"Chaos Staff" ,"WM114", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WM114" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin15 ,"Dragon Staff" ,"WM115", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WM115" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{sinWM1|sin16 ,"SinBaRam Staff" ,"WM116", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WM116" ,INVENTORY_POS_RHAND,SIN_SOUND_STAFF,ITEM_WEAPONCLASS_CASTING},
{ sinWM1 | sin17, "Apostle Wand", "WM117", ITEMSIZE * 2, ITEMSIZE * 3, "Weapon", ITEM_CLASS_WEAPON_ONE, "WM117", INVENTORY_POS_RHAND, SIN_SOUND_STAFF, ITEM_WEAPONCLASS_CASTING },
{ sinWM1 | sin18, "Relic Staff", "WM118", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WM118", INVENTORY_POS_RHAND, SIN_SOUND_STAFF, ITEM_WEAPONCLASS_CASTING },
{ sinWM1 | sin19, "Dragon Staff", "WM119", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WM119", INVENTORY_POS_RHAND, SIN_SOUND_STAFF, ITEM_WEAPONCLASS_CASTING },
{ sinWM1 | sin20, "Wyvern Wand", "WM120", ITEMSIZE * 2, ITEMSIZE * 3, "Weapon", ITEM_CLASS_WEAPON_ONE, "WM120", INVENTORY_POS_RHAND, SIN_SOUND_STAFF, ITEM_WEAPONCLASS_CASTING },
{ sinWM1 | sin21, "Gothic Staff", "WM121", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WM121", INVENTORY_POS_RHAND, SIN_SOUND_STAFF, ITEM_WEAPONCLASS_CASTING },
{ sinWM1 | sin22, "Oracle Wand", "WM122", ITEMSIZE * 2, ITEMSIZE * 3, "Weapon", ITEM_CLASS_WEAPON_ONE, "WM122", INVENTORY_POS_RHAND, SIN_SOUND_STAFF, ITEM_WEAPONCLASS_CASTING },
{ sinWM1 | sin23, "Celestial Staff", "WM123", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WM123", INVENTORY_POS_RHAND, SIN_SOUND_STAFF, ITEM_WEAPONCLASS_CASTING },
{ sinWM1 | sin24, "Astral Staff", "WM124", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WM124", INVENTORY_POS_RHAND, SIN_SOUND_STAFF, ITEM_WEAPONCLASS_CASTING },
//Poles & Spears P1
{sinWP1|sin01 ,"Pole" ,"WP101", ITEMSIZE*1, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WP101" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin02 ,"Spear" ,"WP102", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WP102" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin03 ,"Bill" ,"WP103", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WP103" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin04 ,"Halberd" ,"WP104", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP104" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin05 ,"Horn Scythe" ,"WP105", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP105" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin06 ,"Trident" ,"WP106", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP106" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin07 ,"Enriched Scythe" ,"WP107", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP107" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin08 ,"Double Scythe" ,"WP108", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP108" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin09 ,"Evil Scythe" ,"WP109", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP109" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin10 ,"Silver Bird" ,"WP110", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP110" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin11 ,"Chaos Spear" ,"WP111", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP111" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin12 ,"Titan Spear" ,"WP112", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP112" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin13 ,"Styx Scythe" ,"WP113", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP113" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin14 ,"Dragon's Wing" ,"WP114", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP114" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin15 ,"Rage" ,"WP115", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP115" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWP1|sin16 ,"SinBaRam Darkness" ,"WP116", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WP116" ,INVENTORY_POS_RHAND,SIN_SOUND_POLES,ITEM_WEAPONCLASS_NOT_SHOOTING},
{ sinWP1 | sin17, "Hyper Scythe", "WP117", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WP117", INVENTORY_POS_RHAND, SIN_SOUND_POLES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWP1 | sin18, "Oracle Spear", "WP118", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WP118", INVENTORY_POS_RHAND, SIN_SOUND_POLES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWP1 | sin19, "Immortal Scythe", "WP119", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WP119", INVENTORY_POS_RHAND, SIN_SOUND_POLES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWP1 | sin20, "Extreme Spear", "WP120", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WP120", INVENTORY_POS_RHAND, SIN_SOUND_POLES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWP1 | sin21, "Hellfire Scythe", "WP121", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WP121", INVENTORY_POS_RHAND, SIN_SOUND_POLES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWP1 | sin22, "Dreadnaught Spear", "WP122", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WP122", INVENTORY_POS_RHAND, SIN_SOUND_POLES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWP1 | sin23, "Reaper Scythe", "WP123", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WP123", INVENTORY_POS_RHAND, SIN_SOUND_POLES, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWP1 | sin24, "Dragon Scythe", "WP124", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WP124", INVENTORY_POS_RHAND, SIN_SOUND_POLES, ITEM_WEAPONCLASS_NOT_SHOOTING },
//Bows
{sinWS1|sin01 ,"Short Bow" ,"WS101", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS101" ,INVENTORY_POS_LHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin02 ,"Horned Bow" ,"WS102", ITEMSIZE*2, ITEMSIZE*2,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS102" ,INVENTORY_POS_RHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin03 ,"Hand CrossBow" ,"WS103", ITEMSIZE*2, ITEMSIZE*2,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS103" ,INVENTORY_POS_RHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin04 ,"CrossBow" ,"WS104", ITEMSIZE*3, ITEMSIZE*2,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS104" ,INVENTORY_POS_RHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin05 ,"Battle Bow" ,"WS105", ITEMSIZE*2, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS105" ,INVENTORY_POS_LHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin06 ,"Great Bow" ,"WS106", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS106" ,INVENTORY_POS_LHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin07 ,"War Bow" ,"WS107", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS107" ,INVENTORY_POS_LHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin08 ,"Great CrossBow" ,"WS108", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS108" ,INVENTORY_POS_RHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin09,"MetalHandCrossBow" ,"WS109", ITEMSIZE*2, ITEMSIZE*2,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS109" ,INVENTORY_POS_RHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin10,"Double CrossBow" ,"WS110", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS110" ,INVENTORY_POS_RHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin11 ,"Bone Bow" ,"WS111", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS111" ,INVENTORY_POS_LHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin12 ,"Sagittarius" ,"WS112", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS112" ,INVENTORY_POS_LHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin13,"Ancient CrossBow" ,"WS113", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS113" ,INVENTORY_POS_RHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin14 ,"Titan Bow" ,"WS114", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS114" ,INVENTORY_POS_LHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin15 ,"Chaos Bow" ,"WS115", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS115" ,INVENTORY_POS_LHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin16 ,"Dragon Bow" ,"WS116", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS116" ,INVENTORY_POS_LHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{sinWS1|sin17 ,"SinBaRam CrossBow","WS117", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS117" ,INVENTORY_POS_RHAND,SIN_SOUND_SHOOTERS,ITEM_WEAPONCLASS_SHOOTING},
{ sinWS1 | sin18, "Minotaur Bow", "WS118", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS118", INVENTORY_POS_LHAND, SIN_SOUND_SHOOTERS, ITEM_WEAPONCLASS_SHOOTING },
{ sinWS1 | sin19, "Wave Bow", "WS119", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS119", INVENTORY_POS_LHAND, SIN_SOUND_SHOOTERS, ITEM_WEAPONCLASS_SHOOTING },
{ sinWS1 | sin20, "Grande Bow", "WS120", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS120", INVENTORY_POS_RHAND, SIN_SOUND_SHOOTERS, ITEM_WEAPONCLASS_SHOOTING },
{ sinWS1 | sin21, "Dragon Bow", "WS121", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS121", INVENTORY_POS_LHAND, SIN_SOUND_SHOOTERS, ITEM_WEAPONCLASS_SHOOTING },
{ sinWS1 | sin22, "Revenge Bow", "WS122", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS122", INVENTORY_POS_LHAND, SIN_SOUND_SHOOTERS, ITEM_WEAPONCLASS_SHOOTING },
{ sinWS1 | sin23, "Wyvern Bow", "WS123", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS123", INVENTORY_POS_LHAND, SIN_SOUND_SHOOTERS, ITEM_WEAPONCLASS_SHOOTING },
{ sinWS1 | sin24, "Immortal Bow", "WS124", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS124", INVENTORY_POS_LHAND, SIN_SOUND_SHOOTERS, ITEM_WEAPONCLASS_SHOOTING },
{ sinWS1 | sin25, "Salamander Bow", "WS125", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS125", INVENTORY_POS_LHAND, SIN_SOUND_SHOOTERS, ITEM_WEAPONCLASS_SHOOTING },
//Swords
{sinWS2|sin01 ,"Dagger" ,"WS201", ITEMSIZE*1, ITEMSIZE*2,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS201" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin02 ,"Celtic Dagger" ,"WS202", ITEMSIZE*1, ITEMSIZE*2,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS202" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin03 ,"SwordBreaker" ,"WS203", ITEMSIZE*1, ITEMSIZE*2,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS203" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin04 ,"Short Sword" ,"WS204", ITEMSIZE*1, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS204" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin05 ,"Long Sword" ,"WS205", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS205" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin06 ,"Broad Sword" ,"WS206", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS206" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin07 ,"Blade" ,"WS207", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS207" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin08 ,"Templar Sword" ,"WS208", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS208" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin09 ,"Shield Sword" ,"WS209", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS209" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin10 ,"Plated Sword" ,"WS210", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS210" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin11 ,"Claymore" ,"WS211", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS211" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin12 ,"Slayer" ,"WS212", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS212" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin13 ,"Gigantic Sword" ,"WS213", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS213" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin14 ,"HighLander" ,"WS214", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS214" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin15 ,"Bastard Sword" ,"WS215", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS215" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin16 ,"Fatal Sword" ,"WS216", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS216" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin17 ,"Ancient Sword" ,"WS217", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WS217" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{sinWS2|sin18 ,"Twin Sword" ,"WS218", ITEMSIZE*2, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_TWO,"WS218" ,INVENTORY_POS_RHAND,SIN_SOUND_SWORDS,ITEM_WEAPONCLASS_NOT_SHOOTING},
{ sinWS2 | sin19, "Salamander Sword", "WS219", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS219", INVENTORY_POS_RHAND, SIN_SOUND_SWORDS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWS2 | sin20, "Avenger Sword", "WS220", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WS220", INVENTORY_POS_RHAND, SIN_SOUND_SWORDS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWS2 | sin21, "Titan Sword", "WS221", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS221", INVENTORY_POS_RHAND, SIN_SOUND_SWORDS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWS2 | sin22, "Wyvern Sword", "WS222", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WS222", INVENTORY_POS_RHAND, SIN_SOUND_SWORDS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWS2 | sin23, "Justice Sword", "WS223", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS223", INVENTORY_POS_RHAND, SIN_SOUND_SWORDS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWS2 | sin24, "Extreme Sword", "WS224", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS224", INVENTORY_POS_RHAND, SIN_SOUND_SWORDS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWS2 | sin25, "Mirage Sword", "WS225", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS225", INVENTORY_POS_RHAND, SIN_SOUND_SWORDS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWS2 | sin26, "Legend Sword", "WS226", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WS226", INVENTORY_POS_RHAND, SIN_SOUND_SWORDS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWS2 | sin27, "Tirbing Sword", "WS227", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS227", INVENTORY_POS_RHAND, SIN_SOUND_SWORDS, ITEM_WEAPONCLASS_NOT_SHOOTING },
{ sinWS2 | sin28, "Mythology Sword", "WS228", ITEMSIZE * 2, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_TWO, "WS228", INVENTORY_POS_RHAND, SIN_SOUND_SWORDS, ITEM_WEAPONCLASS_NOT_SHOOTING },
//Throwing Arms
{sinWT1|sin01 ,"Javelin" ,"WT101", ITEMSIZE*1, ITEMSIZE*3,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT101" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin02 ,"War Javelin" ,"WT102", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT102" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin03 ,"Edged Javelin" ,"WT103", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT103" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin04 ,"Steel Javelin" ,"WT104", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT104" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin05 ,"Double Javelin" ,"WT105", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT105" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin06 ,"Elven Javelin" ,"WT106", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT106" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin07 ,"Fatal Javelin" ,"WT107", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT107" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin08 ,"Metal Javelin" ,"WT108", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT108" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin09 ,"Cobra" ,"WT109", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT109" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin10 ,"Winged Javelin" ,"WT110", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT110" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin11 ,"Holy Javelin" ,"WT111", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT111" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin12 ,"Throwing Trident","WT112", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT112" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin13 ,"Wyvern Javelin" , "WT113", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT113" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin14 ,"Twisted Javelin", "WT114", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT114" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin15 ,"Linked Javelin" , "WT115", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT115" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{sinWT1|sin16 ,"SinBaRam Javelin","WT116", ITEMSIZE*1, ITEMSIZE*4,"Weapon",ITEM_CLASS_WEAPON_ONE,"WT116" ,INVENTORY_POS_RHAND,SIN_SOUND_THROWING,ITEM_WEAPONCLASS_SHOOTING},
{ sinWT1 | sin17, "Mystic Javelin", "WT117", ITEMSIZE * 1, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WT117", INVENTORY_POS_RHAND, SIN_SOUND_THROWING, ITEM_WEAPONCLASS_SHOOTING },
{ sinWT1 | sin18, "Extreme Javelin", "WT118", ITEMSIZE * 1, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WT118", INVENTORY_POS_RHAND, SIN_SOUND_THROWING, ITEM_WEAPONCLASS_SHOOTING },
{ sinWT1 | sin19, "Dragon Javelin", "WT119", ITEMSIZE * 1, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WT119", INVENTORY_POS_RHAND, SIN_SOUND_THROWING, ITEM_WEAPONCLASS_SHOOTING },
{ sinWT1 | sin20, "Spike Javelin", "WT120", ITEMSIZE * 1, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WT120", INVENTORY_POS_RHAND, SIN_SOUND_THROWING, ITEM_WEAPONCLASS_SHOOTING },
{ sinWT1 | sin21, "Salamander Javelin", "WT121", ITEMSIZE * 1, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WT121", INVENTORY_POS_RHAND, SIN_SOUND_THROWING, ITEM_WEAPONCLASS_SHOOTING },
{ sinWT1 | sin22, "Immortal Javelin", "WT122", ITEMSIZE * 1, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WT122", INVENTORY_POS_RHAND, SIN_SOUND_THROWING, ITEM_WEAPONCLASS_SHOOTING },
{ sinWT1 | sin23, "Heretic Javelin", "WT123", ITEMSIZE * 1, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WT123", INVENTORY_POS_RHAND, SIN_SOUND_THROWING, ITEM_WEAPONCLASS_SHOOTING },
{ sinWT1 | sin24, "Salamander Javelin", "WT124", ITEMSIZE * 1, ITEMSIZE * 4, "Weapon", ITEM_CLASS_WEAPON_ONE, "WT124", INVENTORY_POS_RHAND, SIN_SOUND_THROWING, ITEM_WEAPONCLASS_SHOOTING },
/*------------------------*
* ��ű��� (Amulet , Ring .. )
*-------------------------*/
//Amulet A1
{sinOA1|sin01 ,"Round Amulet " ,"OA101", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa101" ,0,SIN_SOUND_AMULET},
{sinOA1|sin02 ,"Round Amulet #1" ,"OA102", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa102" ,0,SIN_SOUND_AMULET},
{sinOA1|sin03 ,"Round Amulet #2" ,"OA103", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa103" ,0,SIN_SOUND_AMULET},
{sinOA1|sin04 ,"Round Amulet #3" ,"OA104", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa104" ,0,SIN_SOUND_AMULET},
{sinOA1|sin05 ,"Gem Amulet " ,"OA105", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa105" ,0,SIN_SOUND_AMULET},
{sinOA1|sin06 ,"Gem Amulet #1" ,"OA106", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa106" ,0,SIN_SOUND_AMULET},
{sinOA1|sin07 ,"Gem Amulet #2" ,"OA107", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa107" ,0,SIN_SOUND_AMULET},
{sinOA1|sin08 ,"Gem Amulet #3" ,"OA108", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa108" ,0,SIN_SOUND_AMULET},
{sinOA1|sin09 ,"Magic Amulet " ,"OA109", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa109" ,0,SIN_SOUND_AMULET},
{sinOA1|sin10 ,"Magic Amulet #1" ,"OA110", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa110" ,0,SIN_SOUND_AMULET},
{sinOA1|sin11 ,"Magic Amulet #2" ,"OA111", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa111" ,0,SIN_SOUND_AMULET},
{sinOA1|sin12 ,"Magic Amulet #3" ,"OA112", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa112" ,0,SIN_SOUND_AMULET},
{sinOA1|sin13 ,"Rune Amulet " ,"OA113", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa113" ,0,SIN_SOUND_AMULET},
{sinOA1|sin14 ,"Rune Amulet #1" ,"OA114", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa114" ,0,SIN_SOUND_AMULET},
{sinOA1|sin15 ,"Rune Amulet #2" ,"OA115", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa115" ,0,SIN_SOUND_AMULET},
{sinOA1|sin16 ,"Rune Amulet #3" ,"OA116", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa116" ,0,SIN_SOUND_AMULET},
{sinOA1|sin17 ,"Sealed Amulet " ,"OA117", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa117" ,0,SIN_SOUND_AMULET},
{sinOA1|sin18 ,"Sealed Amulet #1" ,"OA118", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa118" ,0,SIN_SOUND_AMULET},
{sinOA1|sin19 ,"Sealed Amulet #2" ,"OA119", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa119" ,0,SIN_SOUND_AMULET},
{sinOA1|sin20 ,"Sealed Amulet #3" ,"OA120", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa120" ,0,SIN_SOUND_AMULET},
//100����
{sinOA1|sin21 ,"Mystic Amulet", "OA121", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa121" ,0,SIN_SOUND_AMULET},
// �庰 - ���� �߰�
{sinOA1|sin22 ,"Mystic Amulet +1", "OA122", ITEMSIZE*1, ITEMSIZE*1,"Accessory",ITEM_CLASS_AMULET,"oa122" ,0,SIN_SOUND_AMULET},
//유니크
{ sinOA1 | sin30, "켈베쥬 아뮬렛", "OA130", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_AMULET, "oa130", 0, SIN_SOUND_AMULET },
// 박재원 - 산타 아뮬렛 추가
{ sinOA1 | sin32, "Santa Amulet", "OA132", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_AMULET, "oa132", 0, SIN_SOUND_AMULET },
// 박재원 - 이벤트 아뮬렛 추가(7일)
{ sinOA1 | sin33, "Event Amulet", "OA133", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_AMULET, "oa133", 0, SIN_SOUND_AMULET },
// 박재원 - 이벤트 아뮬렛 추가(1시간)
{ sinOA1 | sin34, "Event Amulet(1시간)", "OA134", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_AMULET, "oa133", 0, SIN_SOUND_AMULET },
// 박재원 - 이벤트 아뮬렛 추가(1일)
{ sinOA1 | sin35, "Event Amulet(1일)", "OA135", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_AMULET, "oa133", 0, SIN_SOUND_AMULET },
// 장별 - 눈꽃 목걸이 추가(7일)
{ sinOA1 | sin36, "Snowflower Amulet(7일)", "OA136", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_AMULET, "oa136", 0, SIN_SOUND_AMULET },
// 장별 - 하트 아뮬렛 추가(7일) // 장별 - 캔디데이즈
{ sinOA1 | sin37, "하트아뮬렛(7일)", "OA137", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_AMULET, "oa137", 0, SIN_SOUND_AMULET },
//장별 - 복날 이벤트 아뮬렛 추가
{ sinOA1 | sin38, "삼계탕 아뮬렛", "OA138", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_AMULET, "oa138", 0, SIN_SOUND_AMULET },
// 장별 - 소울스톤 아뮬렛 추가
{ sinOA1 | sin39, "머핀 아뮬렛", "OA139", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_AMULET, "oa139", 0, SIN_SOUND_AMULET },
{ sinOA1 | sin40, "슬리버 아뮬렛", "OA140", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_AMULET, "oa140", 0, SIN_SOUND_AMULET },
{ sinOA1 | sin41, "메트론 아뮬렛", "OA141", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_AMULET, "oa141", 0, SIN_SOUND_AMULET },
{ sinOA1 | sin42, "그로테스크 아뮬렛", "OA142", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_AMULET, "oa142", 0, SIN_SOUND_AMULET },
//Armlet A2
{ sinOA2 | sin01, "Leather Armlets", "OA201", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa201", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin02, "Long Armlets", "OA202", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa202", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin03, "Wide Armlets", "OA203", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa203", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin04, "Fold Armlets", "OA204", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa204", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin05, "Scale Armlets", "OA205", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa205", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin06, "Elven Armlets", "OA206", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa206", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin07, "Solid Armlets", "OA207", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa207", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin08, "Mechanic Armlets", "OA208", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa208", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin09, "Winged Armlets", "OA209", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa209", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin10, "Great Bracelet", "OA210", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa210", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin11, "Steel Bracelet", "OA211", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa211", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin12, "Magicial Bracelet", "OA212", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa212", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin13, "Spiked Bracelet", "OA213", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa213", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin14, "Justice Bracelet", "OA214", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa214", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin15, "Minotaur Bracelet", "OA215", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa215", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin16, "Metal Bracelet", "OA216", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa216", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin17, "Titan Bracelet", "OA217", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa217", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin18, "Saint Bracelet", "OA218", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa218", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin19, "Wyvern Bracelet", "OA219", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa219", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin20, "Dragon Bracelet", "OA220", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa220", 0, SIN_SOUND_Armlet },
//100렙제
{ sinOA2 | sin21, "Inferno Bracelets", "OA221", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa221", 0, SIN_SOUND_Armlet },
// pluto 제작 아이템
{ sinOA2 | sin22, "Phoenix Bracelets", "OA222", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa222", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin23, "Frenzy Bracelets", "OA223", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_ARMLET, "oa223", 0, SIN_SOUND_Armlet },
// 박재원 - 슈퍼 암릿 아이템 추가
{ sinOA2 | sin31, "Super Armlets(7일)", "OA231", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa231", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin32, "Super Armlets(30일)", "OA232", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa232", 0, SIN_SOUND_Armlet },
// 장별 - 슈퍼 암릿(1일)
{ sinOA2 | sin33, "Super Armlets(1일)", "OA233", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa233", 0, SIN_SOUND_Armlet },
{ sinOA2 | sin34, "Super Armlets(1시간)", "OA234", ITEMSIZE * 2, ITEMSIZE * 1, "Accessory", ITEM_CLASS_ARMLET, "oa234", 0, SIN_SOUND_Armlet },
//Magicial Stuffs M1
{ sinOM1 | sin01, "Pearl Beads", "OM101", ITEMSIZE * 1, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om101", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin02, "Crystal Sphere", "OM102", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om102", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin03, "Prizm Sphere", "OM103", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om103", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin04, "Bone Beads", "OM104", ITEMSIZE * 1, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om104", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin05, "Skull Beads", "OM105", ITEMSIZE * 1, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om105", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin06, "Orb", "OM106", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om106", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin07, "Holy Orb", "OM107", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om107", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin08, "Arch Orb", "OM108", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om108", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin09, "Dark Moon", "OM109", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om109", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin10, "Ceremonial Sphere", "OM110", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om110", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin11, "Orbital Beads", "OM111", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om111", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin12, "Harmony Sphere", "OM112", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om112", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin13, "Angel", "OM113", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om113", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin14, "Lucifer", "OM114", ITEMSIZE * 1, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om114", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin15, "Astral Orb", "OM115", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om115", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin16, "Rune Beads", "OM116", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om116", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin17, "Creation Orb", "OM117", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om117", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin18, "Mundane", "OM118", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om118", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin19, "Salamander Beads", "OM119", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om119", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin20, "Cosmos", "OM120", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om120", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin21, "Wyvern Orb", "OM121", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om121", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
//100렙제
{ sinOM1 | sin22, "Ebony Manes", "OM122", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om122", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
// pluto 제작 아이템
{ sinOM1 | sin23, "Avernus Beads", "OM123", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om123", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
{ sinOM1 | sin24, "Malice Rosary", "OM124", ITEMSIZE * 2, ITEMSIZE * 2, "Accessory", ITEM_CLASS_MAGICIAL_STUFFS, "om124", INVENTORY_POS_LHAND, SIN_SOUND_MAGICIAL },
//Ring R1
{ sinOR1 | sin01, "Round Ring ", "OR101", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or101", 0, SIN_SOUND_RING },
{ sinOR1 | sin02, "Round Ring #1", "OR102", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or102", 0, SIN_SOUND_RING },
{ sinOR1 | sin03, "Round Ring #2", "OR103", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or103", 0, SIN_SOUND_RING },
{ sinOR1 | sin04, "Round Ring #3", "OR104", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or104", 0, SIN_SOUND_RING },
{ sinOR1 | sin05, "Gem RIng ", "OR105", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or105", 0, SIN_SOUND_RING },
{ sinOR1 | sin06, "Gem RIng #1", "OR106", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or106", 0, SIN_SOUND_RING },
{ sinOR1 | sin07, "Gem RIng #2", "OR107", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or107", 0, SIN_SOUND_RING },
{ sinOR1 | sin08, "Gem RIng #3", "OR108", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or108", 0, SIN_SOUND_RING },
{ sinOR1 | sin09, "Magic Ring ", "OR109", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or109", 0, SIN_SOUND_RING },
{ sinOR1 | sin10, "Magic Ring #1", "OR110", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or110", 0, SIN_SOUND_RING },
{ sinOR1 | sin11, "Magic Ring #2", "OR111", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or111", 0, SIN_SOUND_RING },
{ sinOR1 | sin12, "Magic Ring #3", "OR112", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or112", 0, SIN_SOUND_RING },
{ sinOR1 | sin13, "Rune Ring ", "OR113", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or113", 0, SIN_SOUND_RING },
{ sinOR1 | sin14, "Rune Ring #1", "OR114", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or114", 0, SIN_SOUND_RING },
{ sinOR1 | sin15, "Rune Ring #2", "OR115", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or115", 0, SIN_SOUND_RING },
{ sinOR1 | sin16, "Rune Ring #3", "OR116", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or116", 0, SIN_SOUND_RING },
{ sinOR1 | sin17, "Sealed Ring ", "OR117", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or117", 0, SIN_SOUND_RING },
{ sinOR1 | sin18, "Sealed Ring #1", "OR118", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or118", 0, SIN_SOUND_RING },
{ sinOR1 | sin19, "Sealed Ring #2", "OR119", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or119", 0, SIN_SOUND_RING },
{ sinOR1 | sin20, "Sealed Ring #3", "OR120", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or120", 0, SIN_SOUND_RING },
//100렙제
{ sinOR1 | sin21, "Mystic Ring", "OR121", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or121", 0, SIN_SOUND_RING },
{ sinOR1 | sin22, "Mystic Ring +1", "OR122", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or122", 0, SIN_SOUND_RING },
//Sheltom S1
{ sinOS1 | sin01, "Lucidy", "OS101", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os101", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin02, "Sereno", "OS102", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os102", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin03, "Fadeo", "OS103", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os103", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin04, "Sparky", "OS104", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os104", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin05, "Raident", "OS105", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os105", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin06, "Transparo", "OS106", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os106", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin07, "Murky", "OS107", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os107", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin08, "Devine", "OS108", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os108", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin09, "Celesto", "OS109", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os109", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin10, "Mirage", "OS110", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os110", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin11, "Inferna", "OS111", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os111", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin12, "Enigma", "OS112", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os112", 0, SIN_SOUND_SHELTOM },
//100렙제
{ sinOS1 | sin13, "Bellum", "OS113", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os113", 0, SIN_SOUND_SHELTOM },
// 박재원 - 오르도 쉘텀 추가(에이징 19, 20차때 사용)
{ sinOS1 | sin14, "Ordo", "OS114", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os114", 0, SIN_SOUND_SHELTOM },
// 박재원 - 매직 쉘텀 14종 추가(매직 포스 제작용) 매직 포스 추가
{ sinOS1 | sin21, "Magic Lucidy", "OS121", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os101", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin22, "Magic Sereno", "OS122", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os102", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin23, "Magic Fadeo", "OS123", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os103", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin24, "Magic Sparky", "OS124", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os104", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin25, "Magic Raident", "OS125", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os105", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin26, "Magic Transparo", "OS126", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os106", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin27, "Magic Murky", "OS127", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os107", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin28, "Magic Devine", "OS128", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os108", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin29, "Magic Celesto", "OS129", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os109", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin30, "Magic Mirage", "OS130", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os110", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin31, "Magic Inferna", "OS131", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os111", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin32, "Magic Enigma", "OS132", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os112", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin33, "Magic Bellum", "OS133", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os113", 0, SIN_SOUND_SHELTOM },
{ sinOS1 | sin34, "Magic Ordo", "OS134", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SHELTOM, "os114", 0, SIN_SOUND_SHELTOM },
//Force Orb
{ sinFO1 | sin01, "Lucidy Force", "FO101", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os101", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin02, "Sereno Force", "FO102", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os102", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin03, "Fadeo Force", "FO103", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os103", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin04, "Sparky Force", "FO104", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os104", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin05, "Raident Force", "FO105", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os105", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin06, "Transparo Force", "FO106", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os106", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin07, "Murky Force", "FO107", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os107", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin08, "Devine Force", "FO108", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os108", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin09, "Celesto Force", "FO109", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os109", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin10, "Mirage Force", "FO110", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os110", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin11, "Inferna Force", "FO111", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os111", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin12, "Enigma Force", "FO112", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os112", 0, SIN_SOUND_SHELTOM },
// 박재원 - 일반 포스 2종 추가(벨룸, 오르도 포스 추가)
{ sinFO1 | sin13, "Bellum Force", "FO113", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os113", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin14, "Ordo Force", "FO114", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os114", 0, SIN_SOUND_SHELTOM },
// 박재원 - 매직 포스 14종 추가(매직 포스 추가)
{ sinFO1 | sin21, "Magic Lucidy Force", "FO121", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os101", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin22, "Magic Sereno Force", "FO122", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os102", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin23, "Magic Fadeo Force", "FO123", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os103", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin24, "Magic Sparky Force", "FO124", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os104", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin25, "Magic Raident Force", "FO125", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os105", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin26, "Magic Transparo Force", "FO126", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os106", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin27, "Magic Murky Force", "FO127", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os107", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin28, "Magic Devine Force", "FO128", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os108", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin29, "Magic Celesto Force", "FO129", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os109", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin30, "Magic Mirage Force", "FO130", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os110", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin31, "Magic Inferna Force", "FO131", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os111", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin32, "Magic Enigma Force", "FO132", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os112", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin33, "Magic Bellum Force", "FO133", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os113", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin34, "Magic Ordo Force", "FO134", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os114", 0, SIN_SOUND_SHELTOM },
// 박재원 -빌링 매직 포스 추가
{ sinFO1 | sin35, "Magic Force(1H)", "FO135", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os135", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin36, "Magic Force(3H)", "FO136", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os136", 0, SIN_SOUND_SHELTOM },
{ sinFO1 | sin37, "Magic Force(1Day)", "FO137", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_FORCEORB, "os137", 0, SIN_SOUND_SHELTOM },
/*------------------------*
* 방어구 (Amor ,Boots .. )
*-------------------------*/
//갑옷
{ sinDA1 | sin01, "Nude", "DA101", ITEMSIZE * 0, ITEMSIZE * 0, "Defense", ITEM_CLASS_ARMOR, "da101", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR }, //Nude
{ sinDA1 | sin02, "Battle Suit", "DA102", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da102", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin03, "Leather Armor", "DA103", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da103", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin04, "Brigandine", "DA104", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da104", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin05, "Steel Armor", "DA105", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da105", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin06, "Round Armor", "DA106", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da106", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin07, "Breast Plate Armor", "DA107", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da107", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin08, "Ring Armor", "DA108", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da108", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin09, "Scale Armor", "DA109", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da109", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin10, "Synthethic Armor", "DA110", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da110", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin11, "Full Plate Armor", "DA111", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da111", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin12, "Full Metal Armor", "DA112", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da112", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin13, "Supreme Armor", "DA113", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da113", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin14, "Spiked Armor", "DA114", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da114", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin15, "Titan Armor", "DA115", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da115", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin16, "Extreme Armor", "DA116", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da116", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin17, "Ancient Armor", "DA117", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da117", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin18, "Minotaur Armor", "DA118", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da118", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin19, "Doom Armor", "DA119", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da119", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin20, "Salamander Armor", "DA120", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da120", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin21, "Wyvern Armor", "DA121", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da121", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin22, "Dragon Armor", "DA122", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da122", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
//100렙제
{ sinDA1 | sin23, "PhoeniX Armor", "DA123", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da123", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
// pluto 제작 아이템
{ sinDA1 | sin24, "Frenzy Armor", "DA124", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da124", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin25, "HighLander Armor", "DA125", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da125", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
//로브
{ sinDA2 | sin01, "Nude", "DA201", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da202", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR }, //Nude
{ sinDA2 | sin02, "Faded Robe", "DA202", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da202", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin03, "Enhanced Robe", "DA203", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da203", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin04, "Battle Robe", "DA204", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da204", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin05, "Elven Robe", "DA205", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da205", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin06, "Dryad Robe", "DA206", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da206", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin07, "Nymph Robe", "DA207", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da207", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin08, "Apperntice Robe", "DA208", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da208", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin09, "Disciple Robe", "DA209", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da209", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin10, "Master Robe", "DA210", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da210", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin11, "Arch Robe", "DA211", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da211", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin12, "Saint Robe", "DA212", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da212", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin13, "Royal Robe", "DA213", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da213", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin14, "Mystic Robe", "DA214", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da214", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin15, "Devine Robe", "DA215", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da215", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin16, "Bishop", "DA216", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da216", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin17, "Celestial Robe", "DA217", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da217", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin18, "Salvation Robe", "DA218", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da218", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin19, "Alchemist Robe", "DA219", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da219", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin20, "Astral Robe", "DA220", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da220", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin21, "Archon Robe", "DA221", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da221", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin22, "Angel Robe", "DA222", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da222", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
//100렙제
{ sinDA2 | sin23, "Ruah Robe", "DA223", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da223", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
// pluto 제작 아이템
{ sinDA2 | sin24, "Eternal Robe", "DA224", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da224", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin25, "Archangel Robe", "DA225", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da225", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
//========
{ sinDA1 | sin31, "파티 코스튬(7일)", "DA131", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da131", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin32, "파티 코스튬(30일)", "DA132", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da132", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin33, "파티 코스튬(7일)", "DA133", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da133", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin34, "파티 코스튬(30일)", "DA134", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da134", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin35, "이다스 아머(7일)", "DA135", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da135", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin36, "이다스 아머(30일)", "DA136", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da136", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin37, "이다스 아머(7일)", "DA137", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da137", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin38, "이다스 아머(30일)", "DA138", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da138", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin39, "실버 파티 코스튬(7일)", "DA139", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da139", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin40, "실버 파티 코스튬(30일)", "DA140", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da140", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin41, "실버 파티 코스튬(7일)", "DA141", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da141", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin42, "실버 파티 코스튬(30일)", "DA142", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da142", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin43, "탈레스 아머(7일)", "DA143", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da143", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin44, "탈레스 아머(30일)", "DA144", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da144", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin45, "탈레스 아머(7일)", "DA145", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da145", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin46, "탈레스 아머(30일)", "DA146", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da146", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
//
{ sinDA2 | sin31, "파티 코스튬(7일)", "DA231", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da231", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin32, "파티 코스튬(30일)", "DA232", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da232", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin33, "파티 코스튬(7일)", "DA233", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da233", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin34, "파티 코스튬(30일)", "DA234", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da234", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin35, "마르다노스 로브(7일)", "DA235", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da235", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin36, "마르다노스 로브(30일)", "DA236", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da236", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin37, "마르다노스 로브(7일)", "DA237", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da237", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin38, "마르다노스 로브(30일)", "DA238", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da238", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin39, "실버 파티 코스튬(7일)", "DA239", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da239", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin40, "실버 파티 코스튬(30일)", "DA240", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da240", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin41, "실버 파티 코스튬(7일)", "DA241", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da241", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin42, "실버 파티 코스튬(30일)", "DA242", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da242", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin43, "미갈 로브(7일)", "DA243", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da243", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin44, "미갈 로브(30일)", "DA244", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da244", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin45, "미갈 로브(7일)", "DA245", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da245", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin46, "미갈 로브(30일)", "DA246", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da246", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
//======================================== 월드컵 응원복 060602 성근 ===============================================================================
{ sinDA1 | sin47, "레플리카 갑옷", "DA147", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da147", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin47, "레리카 로브", "DA247", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da247", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
// pluto 설날 이벤트 한복
{ sinDA1 | sin48, "한복 갑옷", "DA148", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da148", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin48, "한복 로브", "DA248", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da248", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
//일본전용 _LANGUAGE_JAPANESE
{ sinDA1 | sin49, "가이아 아머", "DA149", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da149", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin49, "가이아 로브", "DA249", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da249", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin50, "이리스 아머", "DA150", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da150", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin50, "이리스 로브", "DA250", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da250", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
// 장별 - 대장장이의 혼
{ sinDA1 | sin51, "블랙 가이아 아머", "DA151", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da151", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin51, "블랙 가이아 로브", "DA251", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da251", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin52, "블랙 이리스 아머", "DA152", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da152", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin52, "블랙 이리스 로브", "DA252", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da252", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
// 박재원 - 수영복 복장 추가
{ sinDA1 | sin54, "남자 수영복(30일)", "DA154", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da154", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin54, "남자 수영복(30일)", "DA254", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da254", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA1 | sin55, "여자 수영복(30일)", "DA155", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da155", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
{ sinDA2 | sin55, "여자 수영복(30일)", "DA255", ITEMSIZE * 3, ITEMSIZE * 4, "Defense", ITEM_CLASS_ARMOR, "da255", INVENTORY_POS_ARMOR, SIN_SOUND_ARMOR },
//Boots B1
{ sinDB1 | sin01, "Leather Boots", "DB101", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db101", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin02, "Elven Boots", "DB102", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db102", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin03, "Steel Boots", "DB103", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db103", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin04, "Long Boots", "DB104", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db104", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin05, "Chain Boots", "DB105", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db105", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin06, "Plated Boots", "DB106", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db106", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin07, "Brass Boots", "DB107", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db107", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin08, "War Boots", "DB108", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db108", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin09, "Metal Boots", "DB109", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db109", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin10, "Chaos Boots", "DB110", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db110", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin11, "Holy Boots", "DB111", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db111", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin12, "Spiked Boots", "DB112", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db112", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin13, "Grand Boots", "DB113", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db113", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin14, "Winged Boots", "DB114", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db114", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin15, "Titan Boots", "DB115", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db115", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin16, "Saint Boots", "DB116", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db116", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin17, "Wyvern Boots", "DB117", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db117", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin18, "Rune Boots", "DB118", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db118", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin19, "Royal Boots", "DB119", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db119", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin20, "Dragon Boots", "DB120", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db120", 0, SIN_SOUND_BOOTS },
//100렙제
{ sinDB1 | sin21, "Inferno Boots", "DB121", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db121", 0, SIN_SOUND_BOOTS },
// pluto 제작 아이템
{ sinDB1 | sin22, "Phoenix Boots", "DB122", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db122", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin23, "Frenzy Boots", "DB123", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db123", 0, SIN_SOUND_BOOTS },
//유니크 부츠
{ sinDB1 | sin30, "Mokova Boots ", "DB130", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db130", 0, SIN_SOUND_BOOTS },
// 박재원 - 스피드부츠 아이템(7일, 30일)
{ sinDB1 | sin31, "Speed Boots(7일)", "DB131", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db131", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin32, "Speed Boots(30일)", "DB132", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db132", 0, SIN_SOUND_BOOTS },
// 장별 - 스피드 부츠(1일)
{ sinDB1 | sin33, "Speed Boots(1일)", "DB133", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db133", 0, SIN_SOUND_BOOTS },
{ sinDB1 | sin34, "Speed Boots(1시간)", "DB134", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_BOOTS, "db134", 0, SIN_SOUND_BOOTS },
//Gloves G1
{ sinDG1 | sin01, "Leather Gloves", "DG101", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg101", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin02, "Leather Half Gauntlets", "DG102", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg102", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin03, "Steel Half Gauntlets", "DG103", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg103", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin04, "Clamshell Gauntlets", "DG104", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg104", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin05, "Finger Gauntlets", "DG105", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg105", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin06, "Gothic Mitten Gauntlets", "DG106", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg106", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin07, "War Gauntlets", "DG107", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg107", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin08, "Metal Gauntlets", "DG108", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg108", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin09, "Holy Gauntlets", "DG109", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg109", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin10, "Great Gauntlets", "DG110", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg110", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin11, "Brass Gauntlets", "DG111", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg111", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin12, "Giant Gauntlets", "DG112", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg112", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin13, "Titan Gauntlets", "DG113", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg113", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin14, "Grand Gauntlets", "DG114", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg114", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin15, "Ivory Gauntlets", "DG115", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg115", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin16, "Saint Gauntlets", "DG116", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg116", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin17, "Diamond Gauntlets", "DG117", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg117", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin18, "Angel Gauntlets", "DG118", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg118", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin19, "Relic Gauntlets", "DG119", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg119", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin20, "Dragon Gauntlets", "DG120", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg120", 0, SIN_SOUND_GLOVES },
//100렙제
{ sinDG1 | sin21, "INferno Gauntlets", "DG121", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg121", 0, SIN_SOUND_GLOVES },
// pluto 제작 아이템
{ sinDG1 | sin22, "Phoenix Gauntlets", "DG122", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg122", 0, SIN_SOUND_GLOVES },
{ sinDG1 | sin23, "Frenzy Gauntlets", "DG123", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_GLOVES, "dg123", 0, SIN_SOUND_GLOVES },
//Shields S1 //현재 방패 드롭아이템을 고쳤다 음하하하
{ sinDS1 | sin01, "Wood Shield", "DS101", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_SHIELDS, "ds101", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin02, "Targe", "DS102", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_SHIELDS, "ds102", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin03, "Steel Buckler", "DS103", ITEMSIZE * 2, ITEMSIZE * 2, "Defense", ITEM_CLASS_SHIELDS, "ds103", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin04, "Kite Shield", "DS104", ITEMSIZE * 2, ITEMSIZE * 3, "Defense", ITEM_CLASS_SHIELDS, "ds104", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin05, "Tower Shield", "DS105", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds105", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin06, "Metalic Shield", "DS106", ITEMSIZE * 2, ITEMSIZE * 3, "Defense", ITEM_CLASS_SHIELDS, "ds106", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin07, "Scutum", "DS107", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds107", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin08, "Great Shield", "DS108", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds108", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin09, "Brass Shield", "DS109", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds109", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin10, "Claw Shield", "DS110", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds110", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin11, "Winged Shield", "DS111", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds111", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin12, "Spiked Shield", "DS112", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds112", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin13, "Grand Shield", "DS113", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds113", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin14, "Titan Shield", "DS114", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds114", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin15, "Gladiator Shield", "DS115", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds115", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin16, "Fury Shield", "DS116", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds116", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin17, "Titan Shield", "DS117", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds117", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin18, "Mystic Shield", "DS118", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds118", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin19, "Vampire Shield", "DS119", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds119", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin20, "Dragon Shield", "DS120", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds120", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
//100렙제
{ sinDS1 | sin21, "Phoenix Shield", "DS121", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds121", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
// pluto 제작 아이템
{ sinDS1 | sin22, "Dreadnaught Shield", "DS122", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds122", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
{ sinDS1 | sin23, "Inferno Shield", "DS123", ITEMSIZE * 2, ITEMSIZE * 4, "Defense", ITEM_CLASS_SHIELDS, "ds123", INVENTORY_POS_LHAND, SIN_SOUND_SHIELDS },
//Ring R2
{ sinOR2 | sin01, "절대반지-_-", "OR201", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or201", 0, SIN_SOUND_RING },
{ sinOR2 | sin02, "아케인 링", "OR202", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or202", 0, SIN_SOUND_RING },
{ sinOR2 | sin03, "엠페러 링", "OR203", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or203", 0, SIN_SOUND_RING },
{ sinOR2 | sin04, "포커스 링", "OR204", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or204", 0, SIN_SOUND_RING },
//Ring R2
//작성자 : 박재원, 작성일 : 08.04.07
//내 용 : 클랜치프 링 추가
{ sinOR2 | sin05, "발렌토 링", "OR205", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or205", 0, SIN_SOUND_RING },
{ sinOR2 | sin06, "짱피 링", "OR206", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or206", 0, SIN_SOUND_RING },
{ sinOR2 | sin07, "메키스트 링", "OR207", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or207", 0, SIN_SOUND_RING },
{ sinOR2 | sin08, "이드 링 ", "OR208", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or208", 0, SIN_SOUND_RING },
{ sinOR2 | sin09, "플래틴 마브 링", "OR209", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or209", 0, SIN_SOUND_RING },
{ sinOR2 | sin10, "그레이브 샤킨스 링", "OR210", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or210", 0, SIN_SOUND_RING },
{ sinOR2 | sin11, "싸이클론 링", "OR211", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or211", 0, SIN_SOUND_RING },
{ sinOR2 | sin12, "바우톤 링", "OR212", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or212", 0, SIN_SOUND_RING },
{ sinOR2 | sin13, "길티 고든 링", "OR213", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or213", 0, SIN_SOUND_RING },
{ sinOR2 | sin14, "엘 라시 쿤 링", "OR214", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or214", 0, SIN_SOUND_RING },
{ sinOR2 | sin15, "프라이트 네뮨 링", "OR215", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or215", 0, SIN_SOUND_RING },
{ sinOR2 | sin16, "어파스터시 링", "OR216", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or216", 0, SIN_SOUND_RING },
{ sinOR2 | sin17, "언홀리 나이트 링", "OR217", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or217", 0, SIN_SOUND_RING },
{ sinOR2 | sin18, "베가 드미르 링", "OR218", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or218", 0, SIN_SOUND_RING },
{ sinOR2 | sin19, "베가 드미트리 링", "OR219", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or219", 0, SIN_SOUND_RING },
{ sinOR2 | sin20, "슬레이온 링", "OR220", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or220", 0, SIN_SOUND_RING },
{ sinOR2 | sin21, "블러디 로즈 링", "OR221", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or221", 0, SIN_SOUND_RING },
{ sinOR2 | sin22, "헬싱 링", "OR222", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or222", 0, SIN_SOUND_RING },
{ sinOR2 | sin23, "베르문 악타룬 링", "OR223", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or223", 0, SIN_SOUND_RING },
{ sinOR2 | sin24, "스틱스 아르칸 링", "OR224", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or224", 0, SIN_SOUND_RING },
{ sinOR2 | sin25, "라샤'스 링", "OR225", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or225", 0, SIN_SOUND_RING },
// 박재원 - 산타 링 추가
{ sinOR2 | sin27, "Santa Ring", "OR227", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or227", 0, SIN_SOUND_RING },
// 박재원 - 이벤트 링 추가(7일)
{ sinOR2 | sin28, "Event Ring", "OR228", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or228", 0, SIN_SOUND_RING },
// 박재원 - 이벤트 링 추가(1시간)
{ sinOR2 | sin29, "Event Ring(1시간)", "OR229", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or228", 0, SIN_SOUND_RING },
// 박재원 - 이벤트 링 추가(1일)
{ sinOR2 | sin30, "Event Ring(1일)", "OR230", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or228", 0, SIN_SOUND_RING },
// 박재원 - 보스 몬스터 링 추가
{ sinOR2 | sin31, "Babel Ring", "OR231", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or231", 0, SIN_SOUND_RING },
{ sinOR2 | sin32, "Fury Ring", "OR232", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or232", 0, SIN_SOUND_RING },
// 장별 - 하트링 추가
{ sinOR2 | sin33, "Heart Ring(7일)", "OR233", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or233", 0, SIN_SOUND_RING },
//장별 - 복날 이벤트 링 추가
{ sinOR2 | sin34, "후라이드 치킨 링", "OR234", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or234", 0, SIN_SOUND_RING },
{ sinOR2 | sin35, "양념 치킨 링", "OR235", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or235", 0, SIN_SOUND_RING },
// 장별 - 소울스톤 링 추가
{ sinOR2 | sin36, "디코이 링", "OR236", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or236", 0, SIN_SOUND_RING },
{ sinOR2 | sin37, "타이탄 링", "OR237", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or237", 0, SIN_SOUND_RING },
{ sinOR2 | sin38, "위치 링", "OR238", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or238", 0, SIN_SOUND_RING },
{ sinOR2 | sin39, "새드니스 링", "OR239", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or239", 0, SIN_SOUND_RING },
{ sinOR2 | sin40, "굴가르 링", "OR240", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or240", 0, SIN_SOUND_RING },
//Potion
{ sinPM1 | sin01, "Small Mana Potion", "PM101", ITEMSIZE * 1, ITEMSIZE * 1, "Potion", ITEM_CLASS_POTION, "pm101", 0, SIN_SOUND_POTION },
{ sinPM1 | sin02, "Middle Mana Potion", "PM102", ITEMSIZE * 1, ITEMSIZE * 1, "Potion", ITEM_CLASS_POTION, "pm101", 0, SIN_SOUND_POTION },
{ sinPM1 | sin03, "High Mana Potion", "PM103", ITEMSIZE * 1, ITEMSIZE * 1, "Potion", ITEM_CLASS_POTION, "pm101", 0, SIN_SOUND_POTION },
{ sinPM1 | sin04, "Greate Mana Potion", "PM104", ITEMSIZE * 1, ITEMSIZE * 1, "Potion", ITEM_CLASS_POTION, "pm101", 0, SIN_SOUND_POTION },
{ sinPL1 | sin01, "Small Life Potion", "PL101", ITEMSIZE * 1, ITEMSIZE * 1, "Potion", ITEM_CLASS_POTION, "pl101", 0, SIN_SOUND_POTION },
{ sinPL1 | sin02, "Middle Life Potion", "PL102", ITEMSIZE * 1, ITEMSIZE * 1, "Potion", ITEM_CLASS_POTION, "pl101", 0, SIN_SOUND_POTION },
{ sinPL1 | sin03, "High Life Potion", "PL103", ITEMSIZE * 1, ITEMSIZE * 1, "Potion", ITEM_CLASS_POTION, "pl101", 0, SIN_SOUND_POTION },
{ sinPL1 | sin04, "Greate Life Potion", "PL104", ITEMSIZE * 1, ITEMSIZE * 1, "Potion", ITEM_CLASS_POTION, "pl101", 0, SIN_SOUND_POTION },
{ sinPS1 | sin01, "Small Stamina Potion", "PS101", ITEMSIZE * 1, ITEMSIZE * 1, "Potion", ITEM_CLASS_POTION, "ps101", 0, SIN_SOUND_POTION },
{ sinPS1 | sin02, "Middle Stamina Potion", "PS102", ITEMSIZE * 1, ITEMSIZE * 1, "Potion", ITEM_CLASS_POTION, "ps101", 0, SIN_SOUND_POTION },
{ sinPS1 | sin03, "High Stamina Potion", "PS103", ITEMSIZE * 1, ITEMSIZE * 1, "Potion", ITEM_CLASS_POTION, "ps101", 0, SIN_SOUND_POTION },
{ sinPS1 | sin04, "Greate Stamina Potion", "PS104", ITEMSIZE * 1, ITEMSIZE * 1, "Potion", ITEM_CLASS_POTION, "ps101", 0, SIN_SOUND_POTION },
//귀환 아이템
{ sinEC1 | sin01, "리카르텐 귀환", "EC101", ITEMSIZE * 2, ITEMSIZE * 1, "Potion", ITEM_CLASS_ECORE, "ec101", 0, SIN_SOUND_Armlet },
{ sinEC1 | sin02, "네비스코 귀환", "EC102", ITEMSIZE * 2, ITEMSIZE * 1, "Potion", ITEM_CLASS_ECORE, "ec102", 0, SIN_SOUND_Armlet },
{ sinEC1 | sin03, "루이넨 귀환", "EC103", ITEMSIZE * 2, ITEMSIZE * 1, "Potion", ITEM_CLASS_ECORE, "ec102", 0, SIN_SOUND_Armlet },
{ sinEC1 | sin04, "필라이 귀환", "EC104", ITEMSIZE * 2, ITEMSIZE * 1, "Potion", ITEM_CLASS_ECORE, "ec102", 0, SIN_SOUND_Armlet },
{ sinEC1 | sin05, "유니온 코어", "EC105", ITEMSIZE * 2, ITEMSIZE * 1, "Potion", ITEM_CLASS_ECORE, "ec102", 0, SIN_SOUND_Armlet },
//퀘스트 아이템
{ sinQT1 | sin01, "전업아이템", "QT101", ITEMSIZE * 2, ITEMSIZE * 2, "Quest", ITEM_CLASS_QUEST, "QT101", 0, SIN_SOUND_Armlet },
{ sinQT1 | sin02, "전업아이템", "QT102", ITEMSIZE * 2, ITEMSIZE * 2, "Quest", ITEM_CLASS_QUEST, "QT102", 0, SIN_SOUND_Armlet },
{ sinQT1 | sin03, "전업아이템", "QT103", ITEMSIZE * 2, ITEMSIZE * 2, "Quest", ITEM_CLASS_QUEST, "QT103", 0, SIN_SOUND_Armlet },
//MakeResultItem
{ sinQT1 | sin04, "로얄제리", "QT104", ITEMSIZE * 2, ITEMSIZE * 2, "Make", ITEM_CLASS_QUEST, "QT104", 0, SIN_SOUND_MAGICIAL },
{ sinQT1 | sin05, "발모제", "QT105", ITEMSIZE * 2, ITEMSIZE * 2, "Make", ITEM_CLASS_QUEST, "QT105", 0, SIN_SOUND_MAGICIAL },
{ sinQT1 | sin06, "뱀프쉘텀 ", "QT106", ITEMSIZE * 1, ITEMSIZE * 1, "Quest", ITEM_CLASS_QUEST, "QT106", 0, SIN_SOUND_SHELTOM },
//LevelQuest
{ sinQT1 | sin07, "로이트라", "QT107", ITEMSIZE * 2, ITEMSIZE * 2, "Quest", ITEM_CLASS_QUEST, "QT107", 0, SIN_SOUND_MAGICIAL },
{ sinQT1 | sin08, "칼리아의눈물", "QT108", ITEMSIZE * 2, ITEMSIZE * 2, "Quest", ITEM_CLASS_QUEST, "QT108", 0, SIN_SOUND_MAGICIAL },
{ sinQT1 | sin09, "골덴 뱀프", "QT109", ITEMSIZE * 1, ITEMSIZE * 1, "Quest", ITEM_CLASS_QUEST, "QT109", 0, SIN_SOUND_SHELTOM },
{ sinQT1 | sin10, "실버 뱀프", "QT110", ITEMSIZE * 1, ITEMSIZE * 1, "Quest", ITEM_CLASS_QUEST, "QT110", 0, SIN_SOUND_SHELTOM },
{ sinQT1 | sin11, "브론즈 뱀프", "QT111", ITEMSIZE * 1, ITEMSIZE * 1, "Quest", ITEM_CLASS_QUEST, "QT111", 0, SIN_SOUND_SHELTOM },
{ sinQT1 | sin12, "추천서", "QT112", ITEMSIZE * 2, ITEMSIZE * 2, "Quest", ITEM_CLASS_QUEST, "QT112", 0, SIN_SOUND_Armlet },
{ sinQT1 | sin13, "로열아뮬렛", "QT113", ITEMSIZE * 1, ITEMSIZE * 1, "Quest", ITEM_CLASS_QUEST, "QT113", 0, SIN_SOUND_RING },
//초보 퀘스트
{ sinQT1 | sin14, "막대사탕", "QT114", ITEMSIZE * 1, ITEMSIZE * 2, "Quest", ITEM_CLASS_QUEST, "QT114", 0, SIN_SOUND_SHELTOM },
{ sinQT1 | sin15, "생크림 케익", "QT115", ITEMSIZE * 2, ITEMSIZE * 2, "Quest", ITEM_CLASS_QUEST, "QT115", 0, SIN_SOUND_Armlet },
{ sinQT1 | sin16, "엄프의 망치", "QT116", ITEMSIZE * 2, ITEMSIZE * 2, "Quest", ITEM_CLASS_QUEST, "QT116", 0, SIN_SOUND_RING },
//이벤트 아이템 (송편)
{ sinSP1 | sin01, "작은 송편", "SP101", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SP101", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin02, "큰 송편", "SP102", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SP102", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin03, "삼계탕", "SP103", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SP103", 0, SIN_SOUND_Armlet },
// pluto 선물상자
{ sinSP1 | sin05, "선물상자1", "SP105", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "SP105", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin06, "선물상자2", "SP106", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "SP105", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin07, "선물상자3", "SP107", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "SP105", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin08, "선물상자4", "SP108", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "SP105", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin09, "선물상자5", "SP109", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "SP105", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin10, "선물상자6", "SP110", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "SP105", 0, SIN_SOUND_Armlet },
// 수박 아이템 추가
{ sinSP1 | sin15, "수박", "SP115", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SP115", 0, SIN_SOUND_Armlet },
// {sinSP1|sin16 ,"커플링" ,"SP116", ITEMSIZE*1, ITEMSIZE*1,"Event",ITEM_CLASS_ECORE,"SP116" ,0,SIN_SOUND_Armlet},
// 박재원 - 밤하늘의 소원이벤트
{ sinSP1 | sin26, "별", "SP126", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP126", 0, SIN_SOUND_Armlet },
// 박재원 - 알파벳 조합 이벤트
{ sinSP1 | sin27, "P", "SP127", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP127", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin28, "R", "SP128", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP128", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin29, "I", "SP129", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP129", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin30, "S", "SP130", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP130", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin31, "T", "SP131", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP131", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin32, "O", "SP132", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP132", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin33, "N", "SP133", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP133", 0, SIN_SOUND_Armlet },
// 박재원 - 호랑이 캡슐 추가
{ sinSP1 | sin34, "호랑이 캡슐", "SP134", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "SP134", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin35, "초콜릿", "SP135", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SP135", 0, SIN_SOUND_Armlet },
// 장별 - 캔디데이즈
{ sinSP1 | sin36, "캔디", "SP136", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SP136", 0, SIN_SOUND_Armlet },
// 장별 - 매지컬그린
{ sinSP1 | sin37, "비취", "SP137", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SP137", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin38, "에메랄드", "SP138", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SP138", 0, SIN_SOUND_Armlet },
// 장별 - 카라의 눈물
{ sinSP1 | sin39, "카라의 눈물", "SP139", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SP139", 0, SIN_SOUND_Armlet },
// 박재원 - 2010 월드컵 이벤트(축구공 포션)
{ sinSP1 | sin40, "축구공 포션", "SP140", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP140", 0, SIN_SOUND_Armlet },
// 장별 - 수박 아이템
{ sinSP1 | sin42, "수박", "SP142", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SP142", 0, SIN_SOUND_Armlet },
// 장별 - 영화 혈투
{ sinSP1 | sin60, "영", "SP160", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP160", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin61, "화", "SP161", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP161", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin62, "혈", "SP162", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP162", 0, SIN_SOUND_Armlet },
{ sinSP1 | sin63, "투", "SP163", ITEMSIZE, ITEMSIZE, "Event", ITEM_CLASS_ECORE, "SP163", 0, SIN_SOUND_Armlet },
{ sinGP1 | sin01, "호피 ", "GP101", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
{ sinGP1 | sin02, "홉고블린 ", "GP102", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
{ sinGP1 | sin03, "디코이 ", "GP103", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
{ sinGP1 | sin04, "바곤 ", "GP104", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
{ sinGP1 | sin05, "헤드커터 ", "GP105", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
{ sinGP1 | sin06, "파이곤 ", "GP106", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
{ sinGP1 | sin07, "킹호피 ", "GP107", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
{ sinGP1 | sin08, "헐크 ", "GP108", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
{ sinGP1 | sin09, "랜덤 ", "GP109", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL }, //랜덤 크리스탈
{ sinGP1 | sin10, "클랜 ", "GP110", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL }, //클랜 크리스탈
{ sinGP1 | sin11, "웹 ", "GP111", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL }, //클랜 크리스탈
{ sinGP1 | sin12, "다크스팩터", "GP112", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL }, //클랜 크리스탈
{ sinGP1 | sin13, "아이언가드", "GP113", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL }, //클랜 크리스탈
{ sinGP1 | sin14, "리카르덴 민병대", "GP114", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL }, //클랜 크리스탈
{ sinGP1 | sin15, "리카르덴 경비대", "GP115", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL }, //클랜 크리스탈
{ sinGP1 | sin16, "블레스왕국 수비대", "GP116", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL }, //클랜 크리스탈
///요기에 추가되는 크리스탈을 넣는다
{ sinGP1 | sin17, "스켈레톤 크리스탈", "GP117", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
{ sinGP1 | sin18, "게이아스 크리스탈", "GP118", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
{ sinGP1 | sin19, "인페르나 크리스탈", "GP119", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
// pluto 익스트림 크리스탈 마벨 크리스탈 가디안 디바인
{ sinGP1 | sin20, "익스트림 크리스탈", "GP120", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
{ sinGP1 | sin21, "마벨 크리스탈", "GP121", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
{ sinGP1 | sin22, "가디안 디바인", "GP122", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP101", 0, SIN_SOUND_MAGICIAL },
// 장별 - 소울스톤
{ sinGP2 | sin01, "그린 소울스톤", "GP201", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP201", 0, SIN_SOUND_MAGICIAL },
{ sinGP2 | sin02, "옐로우 소울스톤", "GP202", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP202", 0, SIN_SOUND_MAGICIAL },
{ sinGP2 | sin03, "블루 소울스톤", "GP203", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP203", 0, SIN_SOUND_MAGICIAL },
{ sinGP2 | sin04, "마젠타 소울스톤", "GP204", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP204", 0, SIN_SOUND_MAGICIAL },
{ sinGP2 | sin05, "싸이언 소울스톤", "GP205", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP205", 0, SIN_SOUND_MAGICIAL },
{ sinGP2 | sin06, "바이올렛 소울스톤", "GP206", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP206", 0, SIN_SOUND_MAGICIAL },
{ sinGP2 | sin07, "레드 소울스톤", "GP207", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP207", 0, SIN_SOUND_MAGICIAL },
{ sinGP2 | sin08, "블랙 소울스톤", "GP208", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP208", 0, SIN_SOUND_MAGICIAL },
{ sinGP2 | sin09, "플래티넘 소울스톤", "GP209", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "GP209", 0, SIN_SOUND_MAGICIAL },
{ sinQW1 | sin01, "윙1 ", "QW101", ITEMSIZE * 2, ITEMSIZE * 2, "Wing", ITEM_CLASS_ECORE, "QW101", 0, SIN_SOUND_MAGICIAL }, //메탈
{ sinQW1 | sin02, "윙2 ", "QW102", ITEMSIZE * 2, ITEMSIZE * 2, "Wing", ITEM_CLASS_ECORE, "QW102", 0, SIN_SOUND_MAGICIAL }, //실버
{ sinQW1 | sin03, "윙3 ", "QW103", ITEMSIZE * 2, ITEMSIZE * 2, "Wing", ITEM_CLASS_ECORE, "QW103", 0, SIN_SOUND_MAGICIAL }, //골드
{ sinQW1 | sin04, "윙4 ", "QW104", ITEMSIZE * 2, ITEMSIZE * 2, "Wing", ITEM_CLASS_ECORE, "QW104", 0, SIN_SOUND_MAGICIAL }, //다이아
{ sinQW1 | sin05, "윙5 ", "QW105", ITEMSIZE * 2, ITEMSIZE * 2, "Wing", ITEM_CLASS_ECORE, "QW105", 0, SIN_SOUND_MAGICIAL }, //케이아스
//로스트 아일랜드 성근 추가
{ sinQW1 | sin06, "윙6 ", "QW106", ITEMSIZE * 2, ITEMSIZE * 2, "Wing", ITEM_CLASS_ECORE, "QW106", 0, SIN_SOUND_MAGICIAL }, //익스트림윙
//Make Item (왼쪽)
{ sinMA1 | sin01, "유리병 ", "MA101", ITEMSIZE * 2, ITEMSIZE * 2, "Make", ITEM_CLASS_QUEST, "MA101", 0, SIN_SOUND_MAGICIAL },
//Make Item (오른쪽)
{ sinMA2 | sin01, "벌꿀 ", "MA201", ITEMSIZE * 1, ITEMSIZE * 1, "Make", ITEM_CLASS_QUEST, "MA201", 0, SIN_SOUND_POTION },
{ sinMA2 | sin02, "검은기름 ", "MA202", ITEMSIZE * 1, ITEMSIZE * 1, "Make", ITEM_CLASS_QUEST, "MA202", 0, SIN_SOUND_POTION },
{ sinGF1 | sin01, "별상품권", "GF101", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_QUEST, "GF101", 0, SIN_SOUND_Armlet },
//{sinGF1|sin02 ,"바벨상품권" ,"GF102",ITEMSIZE*2,ITEMSIZE*2,"Event",ITEM_CLASS_QUEST,"GF102",0,SIN_SOUND_Armlet},
{ sinGF1 | sin03, "구미호목걸이1", "GF103", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_QUEST, "GF103", 0, SIN_SOUND_Armlet },
{ sinGF1 | sin04, "구미호목걸이2", "GF104", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_QUEST, "GF104", 0, SIN_SOUND_Armlet },
//반짝반짝 빛나는 가루 //크리스마스
{ sinGF1 | sin05, "빛나는 가루", "GF105", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_QUEST, "GF105", 0, SIN_SOUND_Armlet },
{ sinGF1 | sin06, "반짝 가루", "GF106", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_QUEST, "GF106", 0, SIN_SOUND_Armlet },
// 장별 - 조사원을 찾아라
{ sinGF1 | sin07, "나인아뮬렛", "GF107", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_QUEST, "GF107", 0, SIN_SOUND_Armlet },
{ sinGF1 | sin08, "테일아뮬렛", "GF108", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_QUEST, "GF108", 0, SIN_SOUND_Armlet },
//역겨운 진액
{ sinGF1 | sin02, "역겨운 진액", "GF102", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_QUEST, "GF102", 0, SIN_SOUND_POTION },
//아이템 퍼즐 맞추기 이벤트 (끝날때꺼정 복주머니 인덱스 움지이면안됨)
{ sinPZ1 | sin00, "복주머니", "PZ100", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "PZ100", 0, SIN_SOUND_Armlet },
//Sod2 발생아이템 (인벤토리로 들어오지않고 실시간으로 사용된다)
{ sinSD2 | sin01, "폭탄", "SD201", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SD201", 0, SIN_SOUND_Armlet },
{ sinSD2 | sin02, "시계", "SD202", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SD202", 0, SIN_SOUND_Armlet },
{ sinSD2 | sin03, "아이스크림", "SD203", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SD203", 0, SIN_SOUND_Armlet },
{ sinSD2 | sin04, "토끼인형", "SD204", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SD204", 0, SIN_SOUND_Armlet },
{ sinSD2 | sin05, "달의 수정구", "SD205", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SD205", 0, SIN_SOUND_Armlet },
{ sinSD2 | sin06, "태양의 수정구", "SD206", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SD206", 0, SIN_SOUND_Armlet },
{ sinSD2 | sin07, "천공의 수정구", "SD207", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "SD207", 0, SIN_SOUND_Armlet },
{ sinBS1 | sin01, "벨라토스톤(소)", "BS101", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BS101", 0, SIN_SOUND_SHELTOM },
{ sinBS1 | sin02, "벨라토스톤(중)", "BS102", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BS102", 0, SIN_SOUND_SHELTOM },
{ sinBS1 | sin03, "벨라토스톤(대)", "BS103", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BS103", 0, SIN_SOUND_SHELTOM },
//공성전 발생 아이템(스크롤)
{ sinBC1 | sin01, "아타나시아", "BC101", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC101", 0, SIN_SOUND_Armlet },
{ sinBC1 | sin02, "데들리 에지", "BC102", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC101", 0, SIN_SOUND_Armlet },
{ sinBC1 | sin03, "어베일 오브 이베이드", "BC103", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC101", 0, SIN_SOUND_Armlet },
{ sinBC1 | sin04, "볼스터 리커버리", "BC104", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC101", 0, SIN_SOUND_Armlet },
{ sinBC1 | sin05, "리스토레이션", "BC105", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC101", 0, SIN_SOUND_Armlet },
{ sinBC1 | sin06, "디파이언스 스톤", "BC106", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC102", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin07, "디파이언스 스톤", "BC107", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC102", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin08, "디파이언스 스톤", "BC108", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC102", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin09, "마이트 스톤", "BC109", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC102", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin10, "마이트 스톤", "BC110", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC102", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin11, "마이트 스톤", "BC111", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC102", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin12, "마이트 스톤", "BC112", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC102", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin13, "마이트 스톤", "BC113", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC102", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin14, "마이트 스톤", "BC114", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC102", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin15, "마이트 스톤", "BC115", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC102", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin16, "마이트 스톤", "BC116", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "BC102", 0, SIN_SOUND_SHELTOM },
// 박재원 - 부스터 아이템(생명력, 기력, 근력)
{ sinBC1 | sin21, "생명력 부스터(1시간)", "BC121", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BC121", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin22, "생명력 부스터(3시간)", "BC122", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BC122", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin23, "생명력 부스터(1일)", "BC123", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BC123", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin24, "기력 부스터(1시간)", "BC124", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BC124", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin25, "기력 부스터(3시간)", "BC125", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BC125", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin26, "기력 부스터(1일)", "BC126", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BC126", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin27, "근력 부스터(1시간)", "BC127", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BC127", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin28, "근력 부스터(3시간)", "BC128", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BC128", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin29, "근력 부스터(1일)", "BC129", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BC129", 0, SIN_SOUND_SHELTOM },
// 장별 - 스킬 딜레이
{ sinBC1 | sin30, "스킬 딜레이(1시간)", "BC130", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BC130", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin31, "스킬 딜레이(3시간)", "BC131", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BC131", 0, SIN_SOUND_SHELTOM },
{ sinBC1 | sin32, "스킬 딜레이(1일)", "BC132", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "BC132", 0, SIN_SOUND_SHELTOM },
//프리미엄 부분 유료화 아이템==========================================================================================
{ sinBI1 | sin01, "블루 스톤", "BI101", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI101", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin02, "레드 스톤", "BI102", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI102", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin03, "그린 스톤", "BI103", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI103", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin04, "부활주문서", "BI104", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI104", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin05, "이터널 라이프", "BI105", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI105", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin06, "페이틀 에지", "BI106", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI106", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin07, "어버트 스크롤", "BI107", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI107", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin08, "텔레포트 코어", "BI108", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI108", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin09, "얼큰이 물약", "BI109", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI109", 0, SIN_SOUND_POTION },
{ sinBI1 | sin10, "에이징 스톤", "BI110", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI110", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin11, "코퍼 오어", "BI111", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI111", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin12, "써드 아이즈(1일)", "BI112", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI112", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin13, "경험치증가 포션(1일)", "BI113", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI113", 0, SIN_SOUND_POTION },
{ sinBI1 | sin14, "써드 아이즈(7일)", "BI114", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI114", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin15, "경험치증가 포션(7일)", "BI115", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI115", 0, SIN_SOUND_POTION },
{ sinBI1 | sin16, "헤어틴트 포션(A형)", "BI116", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI116", 0, SIN_SOUND_POTION },
{ sinBI1 | sin17, "헤어틴트 포션(B형)", "BI117", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI117", 0, SIN_SOUND_POTION },
{ sinBI1 | sin18, "헤어틴트 포션(C형)", "BI118", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI118", 0, SIN_SOUND_POTION },
{ sinBI1 | sin19, "뱀피릭 커스핏(15분)", "BI119", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI119", 0, SIN_SOUND_POTION },
{ sinBI1 | sin20, "뱀피릭 커스핏(30분)", "BI120", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI120", 0, SIN_SOUND_POTION },
{ sinBI1 | sin21, "마나 리차징 포션(15분)", "BI121", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI121", 0, SIN_SOUND_POTION },
{ sinBI1 | sin22, "마나 리차징 포션(30분)", "BI122", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI122", 0, SIN_SOUND_POTION },
{ sinBI1 | sin23, "폭 죽", "BI123", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI123", 0, SIN_SOUND_POTION },
//==================== 베트남요청 경험치포션 ( 50 % ) ============= 성근 =================================================
{ sinBI1 | sin24, "경험치증가 포션(50% 1일)", "BI124", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI124", 0, SIN_SOUND_POTION },
{ sinBI1 | sin25, "경험치증가 포션(50% 7일)", "BI125", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI125", 0, SIN_SOUND_POTION },
// pluto 추가 캐쉬 아이템
{ sinBI1 | sin26, "마이트 오브 아웰(7일)", "BI126", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI126", 0, SIN_SOUND_POTION },
{ sinBI1 | sin27, "마이트 오브 아웰(30일)", "BI127", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI127", 0, SIN_SOUND_POTION },
{ sinBI1 | sin28, "마나 리듀스 포션(1일)", "BI128", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI128", 0, SIN_SOUND_POTION },
{ sinBI1 | sin29, "마나 리듀스 포션(7일)", "BI129", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI129", 0, SIN_SOUND_POTION },
{ sinBI1 | sin30, "마이트 오브 아웰2(7일)", "BI130", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI130", 0, SIN_SOUND_POTION },
{ sinBI1 | sin31, "마이트 오브 아웰2(30일)", "BI131", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI131", 0, SIN_SOUND_POTION },
// pluto 펫(해외)
{ sinBI1 | sin32, "피닉스펫(1일)", "BI132", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI132", 0, SIN_SOUND_POTION },
{ sinBI1 | sin33, "피닉스펫(7일)", "BI133", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI132", 0, SIN_SOUND_POTION },
{ sinBI1 | sin34, "피닉스펫(3시간)", "BI134", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI132", 0, SIN_SOUND_POTION },
// {sinBI1|sin35 ,"수표(10000)" ,"BI135",ITEMSIZE*2,ITEMSIZE*1,"Premium",ITEM_CLASS_ECORE,"BI135",0,SIN_SOUND_COIN},
// {sinBI1|sin36 ,"수표(100000)" ,"BI136",ITEMSIZE*2,ITEMSIZE*1,"Premium",ITEM_CLASS_ECORE,"BI135",0,SIN_SOUND_COIN},
// {sinBI1|sin37 ,"수표(500000)" ,"BI137",ITEMSIZE*2,ITEMSIZE*1,"Premium",ITEM_CLASS_ECORE,"BI135",0,SIN_SOUND_COIN},
// {sinBI1|sin38 ,"수표(1000000)" ,"BI138",ITEMSIZE*2,ITEMSIZE*1,"Premium",ITEM_CLASS_ECORE,"BI135",0,SIN_SOUND_COIN},
// 박재원 - 에이징 마스터 아이템 추가
{ sinBI1 | sin36, "에이징 마스터(A)", "BI136", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI136", 0, SIN_SOUND_POTION },
{ sinBI1 | sin37, "에이징 마스터(B)", "BI137", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI137", 0, SIN_SOUND_POTION },
{ sinBI1 | sin38, "에이징 마스터(C)", "BI138", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI138", 0, SIN_SOUND_POTION },
// 박재원 - 스킬 마스터 아이템 추가
{ sinBI1 | sin39, "스킬 마스터(1차)", "BI139", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI139", 0, SIN_SOUND_POTION },
{ sinBI1 | sin40, "스킬 마스터(2차)", "BI140", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI140", 0, SIN_SOUND_POTION },
{ sinBI1 | sin41, "스킬 마스터(3차)", "BI141", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI141", 0, SIN_SOUND_POTION },
// 박재원 - 이동 상점 아이템
{ sinBI1 | sin42, "이동 상점", "BI142", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI142", 0, SIN_SOUND_POTION },
// 박재원 - 경험치증가 포션(100% 1일, 7일 추가)
{ sinBI1 | sin43, "경험치증가 포션(100% 1일)", "BI143", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI143", 0, SIN_SOUND_POTION },
{ sinBI1 | sin44, "경험치증가 포션(100% 7일)", "BI144", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI144", 0, SIN_SOUND_POTION },
// 박재원 - 캐릭터 속성별 스탯 초기화 아이템(5종 - 힘, 정신력, 재능, 민첩성, 건강)
{ sinBI1 | sin45, "힘 스톤", "BI145", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI145", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin46, "정신 스톤", "BI146", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI146", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin47, "재능 스톤", "BI147", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI147", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin48, "민첩성 스톤", "BI148", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI148", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin49, "건강 스톤", "BI149", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI149", 0, SIN_SOUND_SHELTOM },
// 박재원 - 경험치증가 포션(100% 1일, 30일 추가)
{ sinBI1 | sin50, "경험치증가 포션(100% 30일)", "BI150", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI150", 0, SIN_SOUND_POTION },
// 박재원 - 픽닉스 펫(30일) 추가
{ sinBI1 | sin51, "피닉스펫(30일)", "BI151", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI151", 0, SIN_SOUND_POTION },
// 박재원 - 빌링 도우미 펫 추가
{ sinBI1 | sin52, "테리(30일)", "BI152", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI152", 0, SIN_SOUND_POTION },
{ sinBI1 | sin53, "넵시스(30일)", "BI153", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI153", 0, SIN_SOUND_POTION },
{ sinBI1 | sin54, "이오(30일)", "BI154", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI154", 0, SIN_SOUND_POTION },
{ sinBI1 | sin55, "무트(30일)", "BI155", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI155", 0, SIN_SOUND_POTION },
// 박재원 - 엘더 코퍼 오어, 슈퍼 에이징 스톤 추가
{ sinBI1 | sin60, "엘더 코퍼 오어", "BI160", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI160", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin61, "슈퍼 에이징 스톤", "BI161", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI161", 0, SIN_SOUND_SHELTOM },
// 박재원 - 에이징 마스터(2차) 아이템 추가
{ sinBI1 | sin62, "에이징 마스터(D)", "BI162", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI162", 0, SIN_SOUND_POTION },
{ sinBI1 | sin63, "에이징 마스터(E)", "BI163", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI163", 0, SIN_SOUND_POTION },
{ sinBI1 | sin64, "에이징 마스터(F)", "BI164", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI164", 0, SIN_SOUND_POTION },
// 장별 - 빌링 도우미 펫 추가(7일)
{ sinBI1 | sin65, "테리(7일)", "BI165", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI165", 0, SIN_SOUND_POTION },
{ sinBI1 | sin66, "넵시스(7일)", "BI166", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI166", 0, SIN_SOUND_POTION },
{ sinBI1 | sin67, "이오(7일)", "BI167", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI167", 0, SIN_SOUND_POTION },
{ sinBI1 | sin68, "무트(7일)", "BI168", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI168", 0, SIN_SOUND_POTION },
// 장별 - 빌링 도우미 펫 추가
{ sinBI1 | sin69, "테리(1일)", "BI169", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI169", 0, SIN_SOUND_POTION },
{ sinBI1 | sin70, "넵시스(1일)", "BI170", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI170", 0, SIN_SOUND_POTION },
{ sinBI1 | sin71, "이오(1일)", "BI171", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI171", 0, SIN_SOUND_POTION },
{ sinBI1 | sin72, "무트(1일)", "BI172", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI172", 0, SIN_SOUND_POTION },
{ sinBI1 | sin73, "테리(1시간)", "BI173", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI173", 0, SIN_SOUND_POTION },
{ sinBI1 | sin74, "넵시스(1시간)", "BI174", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI174", 0, SIN_SOUND_POTION },
{ sinBI1 | sin75, "이오(1시간)", "BI175", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI175", 0, SIN_SOUND_POTION },
{ sinBI1 | sin76, "무트(1시간)", "BI176", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI176", 0, SIN_SOUND_POTION },
// 장별 - 피닉스펫(1시간)
{ sinBI1 | sin77, "피닉스펫(1시간)", "BI177", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI177", 0, SIN_SOUND_POTION },
// 장별 - 써드 아이즈
{ sinBI1 | sin78, "써드 아이즈(1시간)", "BI178", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI178", 0, SIN_SOUND_SHELTOM },
// 장별 - 경험치증가포션(1시간)
{ sinBI1 | sin79, "경험치증가 포션(1시간)", "BI179", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI179", 0, SIN_SOUND_POTION },
// 장별 - 경험치증가 포션(100% 1시간)
{ sinBI1 | sin80, "경험치 2배 증가약(1시간)", "BI180", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI180", 0, SIN_SOUND_POTION },
// 장별 - 뱀피릭 커스핏(1시간)
{ sinBI1 | sin81, "뱀피릭 커스핏(1시간)", "BI181", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI181", 0, SIN_SOUND_POTION },
// 장별 - 마나 리차징 포션(1시간)
{ sinBI1 | sin82, "마나 리차징 포션(1시간)", "BI182", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI182", 0, SIN_SOUND_POTION },
// 장별 - 마나 리듀스(1시간)
{ sinBI1 | sin83, "마나 리듀스 포션(1시간)", "BI183", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI183", 0, SIN_SOUND_POTION },
// 장별 - 그라비티 스크롤
{ sinBI1 | sin84, "그라비티 스톤", "BI184", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI184", 0, SIN_SOUND_POTION },
// 장별 - 슈퍼 에이징 스톤 1.5
{ sinBI1 | sin85, "슈페리어 코퍼오어", "BI185", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI185", 0, SIN_SOUND_SHELTOM },
// 장별 - 뱀피릭 커스핏 EX
{ sinBI1 | sin86, "슈퍼 뱀피릭 커스핏(1시간)", "BI186", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI186", 0, SIN_SOUND_POTION },
{ sinBI1 | sin87, "슈퍼 뱀피릭 커스핏(3시간)", "BI187", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI187", 0, SIN_SOUND_POTION },
{ sinBI1 | sin88, "슈퍼 뱀피릭 커스핏(1일)", "BI188", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI188", 0, SIN_SOUND_POTION },
// 석지용 - 믹스쳐 리셋 스톤
{ sinBI1 | sin89, "믹스쳐 리셋 스톤", "BI189", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI189", 0, SIN_SOUND_SHELTOM },
// 박재원 - 리스펙 스톤
{ sinBI1 | sin90, "리스펙 스톤", "BI190", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI190", 0, SIN_SOUND_POTION },
// 박재원 - 근력 리듀스 폰션(1일, 7일)
{ sinBI1 | sin91, "근력 리듀스 포션(1일)", "BI191", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI191", 0, SIN_SOUND_POTION },
{ sinBI1 | sin92, "근력 리듀스 포션(7일)", "BI192", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI192", 0, SIN_SOUND_POTION },
// 석지용 - 필드 코어
{ sinBI1 | sin93, "필드 코어(1일)", "BI193", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI193", 0, SIN_SOUND_SHELTOM },
{ sinBI1 | sin94, "필드 코어(7일)", "BI194", ITEMSIZE * 2, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI194", 0, SIN_SOUND_SHELTOM },
//========= 패키지 캐쉬 아이템============성근추가060515=====================================================================
{ sinBI2 | sin01, "Bronze Package(3시간)", "BI201", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI201", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin02, "Bronze Package(1일)", "BI202", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI202", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin03, "Bronze Package(7일)", "BI203", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI203", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin04, "Bronze Package(30일)", "BI204", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI204", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin05, "Siver Package(3시간)", "BI205", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI205", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin06, "Siver Package(1일)", "BI206", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI206", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin07, "Siver Package(7일)", "BI207", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI207", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin08, "Siver Package(30일)", "BI208", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI208", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin09, "Gold Package(3시간)", "BI209", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI209", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin10, "Gold Package(1일)", "BI210", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI210", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin11, "Gold Package(7일)", "BI211", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI211", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin12, "Gold Package(30일)", "BI212", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI212", 0, SIN_SOUND_SHELTOM },
//===========2차 헤어 포션 ================성근추가060524 ========================================================================
{ sinBI2 | sin13, "헤어틴트 포션(D형)", "BI213", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI213", 0, SIN_SOUND_POTION },
{ sinBI2 | sin14, "헤어틴트 포션(E형)", "BI214", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI214", 0, SIN_SOUND_POTION },
{ sinBI2 | sin15, "헤어틴트 포션(F형)", "BI215", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI215", 0, SIN_SOUND_POTION },
{ sinBI2 | sin16, "헤어틴트 포션(G형)", "BI216", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI216", 0, SIN_SOUND_POTION },
{ sinBI2 | sin17, "헤어틴트 포션(H형)", "BI217", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI217", 0, SIN_SOUND_POTION },
//===========3차 헤어 포션 ================성근추가060809 ========================================================================
{ sinBI2 | sin18, "헤어틴트 포션(I형)", "BI218", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI218", 0, SIN_SOUND_POTION },
{ sinBI2 | sin19, "헤어틴트 포션(J형)", "BI219", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI219", 0, SIN_SOUND_POTION },
{ sinBI2 | sin20, "헤어틴트 포션(K형)", "BI220", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI220", 0, SIN_SOUND_POTION },
{ sinBI2 | sin21, "헤어틴트 포션(L형)", "BI221", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI221", 0, SIN_SOUND_POTION },
{ sinBI2 | sin22, "헤어틴트 포션(M형)", "BI222", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI222", 0, SIN_SOUND_POTION },
// pluto 추가 캐쉬 아이템
{ sinBI2 | sin23, "Superior Package(3시간)", "BI223", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI223", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin24, "Superior Package(1일)", "BI224", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI224", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin25, "Superior Package(7일)", "BI225", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI225", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin26, "Bronze Package2(3시간)", "BI226", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI226", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin27, "Bronze Package2(1일)", "BI227", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI227", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin28, "Bronze Package2(7일)", "BI228", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI228", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin29, "Siver Package2(3시간)", "BI229", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI229", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin30, "Siver Package2(1일)", "BI230", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI230", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin31, "Siver Package2(7일)", "BI231", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI231", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin32, "Gold Package2(3시간)", "BI232", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI232", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin33, "Gold Package2(1일)", "BI233", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI233", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin34, "Gold Package2(7일)", "BI234", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI234", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin35, "Superior Package2(3시간)", "BI235", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI235", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin36, "Superior Package2(1일)", "BI236", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI236", 0, SIN_SOUND_SHELTOM },
{ sinBI2 | sin37, "Superior Package2(7일)", "BI237", ITEMSIZE * 1, ITEMSIZE * 1, "Premium", ITEM_CLASS_ECORE, "BI237", 0, SIN_SOUND_SHELTOM },
//유니크
{ sinOR2 | sin05, "발렌토 링", "OR205", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_RING, "or205", 0, SIN_SOUND_RING },
//무기류 퍼즐
{ sinPZ1 | sin01, "퍼즐1", "PZ101", ITEMSIZE * 2, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ1 | sin02, "퍼즐2", "PZ102", ITEMSIZE * 2, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ1 | sin03, "퍼즐3", "PZ103", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ1 | sin04, "퍼즐4", "PZ104", ITEMSIZE * 2, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ1 | sin05, "퍼즐5", "PZ105", ITEMSIZE * 2, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ1 | sin06, "퍼즐6", "PZ106", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ1 | sin07, "퍼즐7", "PZ107", ITEMSIZE * 2, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ1 | sin08, "퍼즐8", "PZ108", ITEMSIZE * 2, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
//방어구 퍼즐
{ sinPZ2 | sin01, "퍼즐1", "PZ201", ITEMSIZE * 2, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ2 | sin02, "퍼즐2", "PZ202", ITEMSIZE * 2, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ2 | sin03, "퍼즐3", "PZ203", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ2 | sin04, "퍼즐4", "PZ204", ITEMSIZE * 2, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ2 | sin05, "퍼즐5", "PZ205", ITEMSIZE * 2, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ2 | sin06, "퍼즐6", "PZ206", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ2 | sin07, "퍼즐7", "PZ207", ITEMSIZE * 2, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
{ sinPZ2 | sin08, "퍼즐8", "PZ208", ITEMSIZE * 2, ITEMSIZE * 1, "Event", ITEM_CLASS_ECORE, "PZ101", 0, SIN_SOUND_Armlet },
//발렌타인데이 초콜릿 & 화이트데이 사탕
{ sinCH1 | sin01, "초콜렛1", "CH101", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "CH101", 0, SIN_SOUND_Armlet },
{ sinCH1 | sin02, "초콜렛2", "CH102", ITEMSIZE * 2, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "CH102", 0, SIN_SOUND_Armlet },
{ sinCH1 | sin03, "사탕1", "CH103", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "CH103", 0, SIN_SOUND_Armlet },
{ sinCH1 | sin04, "사탕2", "CH104", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "CH104", 0, SIN_SOUND_Armlet },
//Seel (아이템 재구성)
{ sinSE1 | sin01, "제라", "SE101", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SEEL, "SE101", 0, SIN_SOUND_SHELTOM },
{ sinSE1 | sin02, "니이드", "SE102", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SEEL, "SE102", 0, SIN_SOUND_SHELTOM },
{ sinSE1 | sin03, "지푸", "SE103", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SEEL, "SE103", 0, SIN_SOUND_SHELTOM },
// 박재원 - 테이와즈 씰 추가
{ sinSE1 | sin04, "테이와즈", "SE104", ITEMSIZE * 1, ITEMSIZE * 1, "Accessory", ITEM_CLASS_SEEL, "SE104", 0, SIN_SOUND_SHELTOM },
{ sinPR1 | sin01, "보라빛 광석", "PR101", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR101", 0, SIN_SOUND_SHELTOM },
{ sinPR1 | sin02, "은빛 광석", "PR102", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR102", 0, SIN_SOUND_SHELTOM },
{ sinPR1 | sin03, "금빛 광석", "PR103", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR103", 0, SIN_SOUND_SHELTOM },
{ sinPR1 | sin04, "하늘빛 광석", "PR104", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR104", 0, SIN_SOUND_SHELTOM },
{ sinPR1 | sin05, "남빛 광석", "PR105", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR105", 0, SIN_SOUND_SHELTOM },
{ sinPR1 | sin06, "주황빛 광석", "PR106", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR106", 0, SIN_SOUND_SHELTOM },
{ sinPR1 | sin07, "붉은빛 광석", "PR107", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR107", 0, SIN_SOUND_SHELTOM },
{ sinPR1 | sin08, "초록빛 광석", "PR108", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR108", 0, SIN_SOUND_SHELTOM },
{ sinPR2 | sin01, "보라빛 수정", "PR201", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR201", 0, SIN_SOUND_SHELTOM },
{ sinPR2 | sin02, "은빛 수정", "PR202", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR202", 0, SIN_SOUND_SHELTOM },
{ sinPR2 | sin03, "금빛 수정", "PR203", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR203", 0, SIN_SOUND_SHELTOM },
{ sinPR2 | sin04, "하늘빛 수정", "PR204", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR204", 0, SIN_SOUND_SHELTOM },
{ sinPR2 | sin05, "남빛 수정", "PR205", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR205", 0, SIN_SOUND_SHELTOM },
{ sinPR2 | sin06, "주황빛 수정", "PR206", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR206", 0, SIN_SOUND_SHELTOM },
{ sinPR2 | sin07, "붉은빛 수정", "PR207", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR207", 0, SIN_SOUND_SHELTOM },
{ sinPR2 | sin08, "초록빛 수정", "PR208", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR208", 0, SIN_SOUND_SHELTOM },
{ sinPR2 | sin09, "눈의 결정", "PR209", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR209", 0, SIN_SOUND_SHELTOM }, // 장별
{ sinPR2 | sin10, "스노우플라워", "PR210", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR210", 0, SIN_SOUND_SHELTOM }, // 장별
{ sinPR2 | sin11, "하얀 눈물", "PR211", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR211", 0, SIN_SOUND_SHELTOM }, // 장별
{ sinPR2 | sin12, "녹슨 수정", "PR212", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR212", 0, SIN_SOUND_SHELTOM }, // 장별 - 대장장이의 혼
{ sinPR2 | sin13, "원석 조각", "PR213", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR213", 0, SIN_SOUND_SHELTOM }, // 장별 - 대장장이의 혼
{ sinPR2 | sin14, "검은빛 수정", "PR214", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR214", 0, SIN_SOUND_SHELTOM }, // 장별 - 대장장이의 혼
{ sinPR3 | sin01, "보라빛 룬(A)", "PR301", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR301", 0, SIN_SOUND_SHELTOM },
{ sinPR3 | sin02, "은빛 룬(A)", "PR302", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR302", 0, SIN_SOUND_SHELTOM },
{ sinPR3 | sin03, "금빛 룬(A)", "PR303", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR303", 0, SIN_SOUND_SHELTOM },
{ sinPR3 | sin04, "하늘빛 룬(A)", "PR304", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR304", 0, SIN_SOUND_SHELTOM },
{ sinPR3 | sin05, "남빛 룬(A)", "PR305", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR305", 0, SIN_SOUND_SHELTOM },
{ sinPR3 | sin06, "주황빛 룬(A)", "PR306", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR306", 0, SIN_SOUND_SHELTOM },
{ sinPR3 | sin07, "붉은빛 룬(A)", "PR307", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR307", 0, SIN_SOUND_SHELTOM },
{ sinPR3 | sin08, "초록빛 룬(A)", "PR308", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR308", 0, SIN_SOUND_SHELTOM },
{ sinPR3 | sin09, "스노우 룬(A)", "PR309", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR309", 0, SIN_SOUND_SHELTOM }, // 장별
{ sinPR3 | sin10, "플라워 룬(A)", "PR310", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR310", 0, SIN_SOUND_SHELTOM }, // 장별
{ sinPR3 | sin11, "화이트 룬(A)", "PR311", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR311", 0, SIN_SOUND_SHELTOM }, // 장별
{ sinPR3 | sin12, "일루젼 룬(A)", "PR312", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR312", 0, SIN_SOUND_SHELTOM }, // 장별 - 대장장이의 혼
{ sinPR3 | sin13, "아이디얼 룬(A)", "PR313", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR313", 0, SIN_SOUND_SHELTOM }, // 장별 - 대장장이의 혼
{ sinPR3 | sin14, "브레이크 룬(A)", "PR314", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR314", 0, SIN_SOUND_SHELTOM }, // 장별 - 대장장이의 혼
{ sinPR4 | sin01, "보라빛 룬(B)", "PR401", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR401", 0, SIN_SOUND_SHELTOM },
{ sinPR4 | sin02, "은빛 룬(B)", "PR402", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR402", 0, SIN_SOUND_SHELTOM },
{ sinPR4 | sin03, "금빛 룬(B)", "PR403", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR403", 0, SIN_SOUND_SHELTOM },
{ sinPR4 | sin04, "하늘빛 룬(B)", "PR404", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR404", 0, SIN_SOUND_SHELTOM },
{ sinPR4 | sin05, "남빛 룬(B)", "PR405", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR405", 0, SIN_SOUND_SHELTOM },
{ sinPR4 | sin06, "주황빛 룬(B)", "PR406", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR406", 0, SIN_SOUND_SHELTOM },
{ sinPR4 | sin07, "붉은빛 룬(B)", "PR407", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR407", 0, SIN_SOUND_SHELTOM },
{ sinPR4 | sin08, "초록빛 룬(B)", "PR408", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR408", 0, SIN_SOUND_SHELTOM },
{ sinPR4 | sin09, "스노우 룬(B)", "PR409", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR409", 0, SIN_SOUND_SHELTOM }, // 장별
{ sinPR4 | sin10, "플라워 룬(B)", "PR410", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR410", 0, SIN_SOUND_SHELTOM }, // 장별
{ sinPR4 | sin11, "화이트 룬(B)", "PR411", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR411", 0, SIN_SOUND_SHELTOM }, // 장별
{ sinPR4 | sin12, "일루젼 룬(B)", "PR412", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR412", 0, SIN_SOUND_SHELTOM }, // 장별 - 대장장이의 혼
{ sinPR4 | sin13, "아이디얼 룬(B)", "PR413", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR413", 0, SIN_SOUND_SHELTOM }, // 장별 - 대장장이의 혼
{ sinPR4 | sin14, "브레이크 룬(B)", "PR414", ITEMSIZE * 1, ITEMSIZE * 1, "Event", ITEM_CLASS_SEEL, "PR414", 0, SIN_SOUND_SHELTOM }, // 장별 - 대장장이의 혼
{ sinWR1 | sin01, "잊혀진 무기 제작서", "WR101", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "WR101", 0, SIN_SOUND_SHELTOM },
{ sinWR1 | sin02, "고대의 무기 제작서", "WR102", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "WR102", 0, SIN_SOUND_SHELTOM },
{ sinWR1 | sin03, "대지의 무기 제작서", "WR103", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "WR103", 0, SIN_SOUND_SHELTOM },
{ sinWR1 | sin04, "어둠의 무기 제작서", "WR104", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "WR104", 0, SIN_SOUND_SHELTOM },
{ sinWR1 | sin05, "화염의 무기 제작서", "WR105", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "WR105", 0, SIN_SOUND_SHELTOM },
{ sinWR1 | sin06, "바람의 무기 제작서", "WR106", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "WR106", 0, SIN_SOUND_SHELTOM },
{ sinWR1 | sin07, "태양의 무기 제작서", "WR107", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "WR107", 0, SIN_SOUND_SHELTOM },
{ sinWR1 | sin08, "광포한 무기 제작서", "WR108", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "WR108", 0, SIN_SOUND_SHELTOM },
{ sinWR1 | sin09, "천상의 무기 제작서", "WR109", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "WR109", 0, SIN_SOUND_SHELTOM },
{ sinDR1 | sin01, "잊혀진 방어구 제작서", "DR101", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "DR101", 0, SIN_SOUND_SHELTOM },
{ sinDR1 | sin02, "고대의 방어구 제작서", "DR102", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "DR102", 0, SIN_SOUND_SHELTOM },
{ sinDR1 | sin03, "대지의 방어구 제작서", "DR103", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "DR103", 0, SIN_SOUND_SHELTOM },
{ sinDR1 | sin04, "어둠의 방어구 제작서", "DR104", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "DR104", 0, SIN_SOUND_SHELTOM },
{ sinDR1 | sin05, "화염의 방어구 제작서", "DR105", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "DR105", 0, SIN_SOUND_SHELTOM },
{ sinDR1 | sin06, "바람의 방어구 제작서", "DR106", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "DR106", 0, SIN_SOUND_SHELTOM },
{ sinDR1 | sin07, "태양의 방어구 제작서", "DR107", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "DR107", 0, SIN_SOUND_SHELTOM },
{ sinDR1 | sin08, "광포한 방어구 제작서", "DR108", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "DR108", 0, SIN_SOUND_SHELTOM },
{ sinDR1 | sin09, "천상의 방어구 제작서", "DR109", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "DR109", 0, SIN_SOUND_SHELTOM },
{ sinDR1 | sin10, "포설의 제작서", "DR110", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "DR110", 0, SIN_SOUND_SHELTOM }, // 장별
{ sinDR1 | sin11, "기억의 제작서", "DR111", ITEMSIZE * 1, ITEMSIZE * 2, "Event", ITEM_CLASS_ECORE, "DR111", 0, SIN_SOUND_SHELTOM }, // 장별 - 대장장이의 혼
//돈 젤루 마지막에 넣어야한다 (왜인지는 기억이 안나네 ........)
{sinGG1|sin01 ,"Gold" ,"GG101", ITEMSIZE*1, ITEMSIZE*1,"Gold", 0 ,"DRCOIN" , 0 ,SIN_SOUND_COIN},
{sinGG1|sin02 ,"Exp" ,"GG102", ITEMSIZE*1, ITEMSIZE*1,"Exp" , 0 ,"DRExp" , 0 ,SIN_SOUND_MAGICIAL},
};
/*----------------------------------------------------------------------------*
* 클래스 초기, 종료
*-----------------------------------------------------------------------------*/
cITEM::cITEM()
{
}
cITEM::~cITEM()
{
}
/*----------------------------------------------------------------------------*
* 초기화
*-----------------------------------------------------------------------------*/
void cITEM::Init()
{
for(int cnt=0;cnt<MAX_ITEM;cnt++)//�ڵ带 �����Ѵ�
sItem[cnt].sItemInfo.CODE = sItem[cnt].CODE;
MatItemInfoBox = CreateTextureMaterial( "Image\\SinImage\\Items\\ItemInfoBox.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
MatItemInfoBox_TopLeft = CreateTextureMaterial( "Image\\SinImage\\Items\\ItemInfoBox\\BoxTopLeft.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
MatItemInfoBox_TopRight = CreateTextureMaterial( "Image\\SinImage\\Items\\ItemInfoBox\\BoxTopRight.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
MatItemInfoBox_TopCenter = CreateTextureMaterial( "Image\\SinImage\\Items\\ItemInfoBox\\BoxTopCenter.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
MatItemInfoBox_BottomLeft = CreateTextureMaterial( "Image\\SinImage\\Items\\ItemInfoBox\\BoxBottomLeft.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
MatItemInfoBox_BottomRight = CreateTextureMaterial( "Image\\SinImage\\Items\\ItemInfoBox\\BoxBottomRight.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
MatItemInfoBox_BottomCenter = CreateTextureMaterial( "Image\\SinImage\\Items\\ItemInfoBox\\BoxBottomCenter.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
MatItemInfoBox_Left = CreateTextureMaterial( "Image\\SinImage\\Items\\ItemInfoBox\\BoxLeft.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
MatItemInfoBox_Right = CreateTextureMaterial( "Image\\SinImage\\Items\\ItemInfoBox\\BoxRight.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
MatItemInfoBox_Center = CreateTextureMaterial( "Image\\SinImage\\Items\\ItemInfoBox\\BoxCenter.tga" , 0, 0, 0,0, SMMAT_BLEND_ALPHA );
Load();
int CheckCount = 0;
while(1)
{
//////////////////////�ȼ����� ������ ���
if(NotSell_Item_CODE[NotSell_Item_CODECnt])
NotSell_Item_CODECnt++;
else
CheckCount++;
if(NotSell_Item_MASK[NotSell_Item_MASKCnt])
NotSell_Item_MASKCnt++;
else
CheckCount++;
if(NotSell_Item_KIND[NotSell_Item_KINDCnt])
NotSell_Item_KINDCnt++;
else
CheckCount++;
//////////////////////���������� �����۸��
if(NotDrow_Item_CODE[NotDrow_Item_CODECnt])
NotDrow_Item_CODECnt++;
else
CheckCount++;
if(NotDrow_Item_MASK[NotDrow_Item_MASKCnt])
NotDrow_Item_MASKCnt++;
else
CheckCount++;
if(NotDrow_Item_KIND[NotDrow_Item_KINDCnt])
NotDrow_Item_KINDCnt++;
else
CheckCount++;
//////////////////////�����Ҽ����� �����۸��
if(NotSet_Item_CODE[NotSet_Item_CODECnt])
NotSet_Item_CODECnt++;
else
CheckCount++;
if(NotSet_Item_MASK[NotSet_Item_MASKCnt])
NotSet_Item_MASKCnt++;
else
CheckCount++;
if(NotSet_Item_KIND[NotSet_Item_KINDCnt])
NotSet_Item_KINDCnt++;
else
CheckCount++;
if(CheckCount >= 9)
break;
}
// pluto ���� ������ ���� ���� �ʱ�ȭ
memset( g_Manufacture_ItemInfo, 0, sizeof(SManufacture_ResultItemInfo) );
}
/*----------------------------------------------------------------------------*
* Bmp파일을 로드한다
*-----------------------------------------------------------------------------*/
void cITEM::Load()
{
AgingBar = LoadDibSurfaceOffscreen("image\\Sinimage\\shopall\\Aging\\Bar.bmp");
AgingGage = LoadDibSurfaceOffscreen("image\\Sinimage\\shopall\\Aging\\Bar_.bmp");
AgingBar2 = LoadDibSurfaceOffscreen("image\\Sinimage\\shopall\\Aging\\Aging.bmp");
}
/*----------------------------------------------------------------------------*
* Release
*-----------------------------------------------------------------------------*/
void cITEM::Release()
{
if(AgingBar)
{
AgingBar->Release();
AgingBar = 0;
}
if(AgingGage)
{
AgingGage->Release();
AgingGage = 0;
}
if(AgingBar2)
{
AgingBar2->Release();
AgingBar2 =0;
}
}
/*----------------------------------------------------------------------------*
* 그리기
*-----------------------------------------------------------------------------*/
void cITEM::Draw()
{
int t=0,i =0;
char TempBuff[64];
int len=0,len2=0;
int tSetTextXposi=0;
int x,y;
len= lstrlen(szInfoBuff);
memset(&TempBuff,0,sizeof(TempBuff));
for( i = 0 ; i < len ; i++)
{
if(szInfoBuff[i] == '\r')
{
memcpy(TempBuff,szInfoBuff,i);
break;
}
}
len2 = lstrlen(TempBuff);
tSetTextXposi = (int)(ItemBoxPosi.x + (((ItemBoxSize.x*16)/2)- ((len2*5.5)/2))+(len2*5.5));
if(MouseItem.Flag)
{
if(!MouseItem.lpItem)
dsDrawColorBox( RGBA_MAKE(125,125,255,125) ,MouseItem.x ,MouseItem.y,MouseItem.w ,MouseItem.h);
x = pCursorPos.x-(MouseItem.w/2);
y = pCursorPos.y -(MouseItem.h/2);
dsDrawOffsetArray = dsARRAY_TOP;
DrawSprite(x , y , MouseItem.lpItem,0,0,MouseItem.w,MouseItem.h);
if((MouseItem.sItemInfo.CODE & sinITEM_MASK2) == sinPZ1 || (MouseItem.sItemInfo.CODE & sinITEM_MASK2) == sinPZ2)
{
if(MouseItem.sItemInfo.PotionCount == 2)
{
if(MouseItem.w == 44 )
DrawSprite(x , y , cInvenTory.lpPuzzlewidth,0,0,44,22);
if(MouseItem.w == 22 )
DrawSprite(x , y, cInvenTory.lpPuzzleHeight,0,0,22,44);
}
}
if(cMyShop.OpenFlag)
dsDrawColorBox( RGBA_MAKE(0,0,128,125) ,x ,y,MouseItem.w ,MouseItem.h);
}
if(sinShowItemInfoFlag)
{
if(sinShowItemInfoFlag == 1)dsDrawOffsetArray = dsARRAY_TOP;
else dsDrawOffsetArray = dsARRAY_BOTTOM;
for(i = 0; i < ItemBoxSize.x ; i++)
{
for(int j = 0; j< ItemBoxSize.y ; j++)
{
if(i == 0 && j == 0 ) //�������
dsDrawTexImage( MatItemInfoBox_TopLeft , ItemBoxPosi.x+(i*16) , ItemBoxPosi.y+(j*16), 16, 16 , 255 );
if(j == 0 && i !=0 && i+1 < ItemBoxSize.x ) //���
dsDrawTexImage( MatItemInfoBox_TopCenter , ItemBoxPosi.x+(i*16) , ItemBoxPosi.y+(j*16), 16, 16 , 255 );
if(j == 0 && i+1 == ItemBoxSize.x) //�������
dsDrawTexImage( MatItemInfoBox_TopRight , ItemBoxPosi.x+(i*16) , ItemBoxPosi.y+(j*16), 16, 16 , 255 );
if(i == 0 && j != 0 && j+1 != ItemBoxSize.y) //���� �ٰŸ�
dsDrawTexImage( MatItemInfoBox_Left , ItemBoxPosi.x+(i*16) , ItemBoxPosi.y+(j*16), 16, 16 , 255 );
if(i != 0 && j != 0 && i+1 !=ItemBoxSize.x && j+1 !=ItemBoxSize.y) //��� �丷
dsDrawTexImage( MatItemInfoBox_Center , ItemBoxPosi.x+(i*16) , ItemBoxPosi.y+(j*16), 16, 16 , 255 );
if(i+1 == ItemBoxSize.x && j != 0 && j+1 != ItemBoxSize.y) //���� �ٰŸ�
dsDrawTexImage( MatItemInfoBox_Right , ItemBoxPosi.x+(i*16) , ItemBoxPosi.y+(j*16), 16, 16 , 255 );
if(i == 0 && j+1 == ItemBoxSize.y) //�عٴ� ����
dsDrawTexImage( MatItemInfoBox_BottomLeft , ItemBoxPosi.x+(i*16) , ItemBoxPosi.y+(j*16), 16, 16 , 255 );
if(i != 0 && j+1 == ItemBoxSize.y && i+1 !=ItemBoxSize.x)//�عٴ� ���
dsDrawTexImage( MatItemInfoBox_BottomCenter , ItemBoxPosi.x+(i*16) , ItemBoxPosi.y+(j*16), 16, 16 , 255 );
if(j+1 == ItemBoxSize.y && i+1 ==ItemBoxSize.x)//�عٴ� ������
dsDrawTexImage( MatItemInfoBox_BottomRight , ItemBoxPosi.x+(i*16) , ItemBoxPosi.y+(j*16), 16, 16 , 255 );
}
}
//�ڽ� ũ�� ��Ʈ
//dsDrawTexImage( MatItemInfoBox_TopCenter , ItemBoxPosi.x , ItemBoxPosi.y, 158, 100 , 255 );
if(tWeaponClass == 1)
DrawSprite(tSetTextXposi , ItemBoxPosi.y+8 , cInvenTory.lpShowWeaponClass[0] ,0,0,18,16);
if(tWeaponClass == 2)
DrawSprite(tSetTextXposi , ItemBoxPosi.y+8 , cInvenTory.lpShowWeaponClass[1] ,0,0,18,16);
if(tWeaponClass == 3)
DrawSprite(tSetTextXposi , ItemBoxPosi.y+8 , cInvenTory.lpShowWeaponClass[2] ,0,0,18,16);
if(tWeaponClass == 4)
DrawSprite(tSetTextXposi , ItemBoxPosi.y+8 , cInvenTory.lpShowWeaponClass[3] ,0,0,18,16);
if(AgingGageFlag)
{
if(AgingGageFlag == 1)
DrawSprite(ItemBoxPosi.x+14 , ItemBoxPosi.y+30 , AgingBar ,0,0,130,19);
if(AgingGageFlag ==2)
DrawSprite(ItemBoxPosi.x+14+53 , ItemBoxPosi.y+30 , AgingBar2 ,0,0,23,19);
if(AgingBarLenght)
DrawSprite(ItemBoxPosi.x+16 , ItemBoxPosi.y+37 , AgingGage ,0,0,AgingBarLenght,4);
}
}
}
/*----------------------------------------------------------------------------*
* 메인
*-----------------------------------------------------------------------------*/
void cITEM::Main()
{
sinShowItemInfoFlag = 0; //������ ������ġ�ΰ����� �ʱ�ȭ���ش�
if(MouseItem.Flag) //�������� ��ġ ����
{
if(!sinMessageBoxShowFlag)
{
MouseItem.x = pCursorPos.x-(MouseItem.w/2);
MouseItem.y = pCursorPos.y -(MouseItem.h/2);
}
}
if(cMyShop.OpenFlag)
{
if(MyShopMouseItem.Flag)
{
MyShopMouseItem.x = pCursorPos.x-(MyShopMouseItem.w/2);
MyShopMouseItem.y = pCursorPos.y -(MyShopMouseItem.h/2);
}
}
///////������ ���̺� ������ �����Ѵ� 10�ʿ� �ѹ� üũ
CheckItemTable();
}
void cITEM::GetMousePos(int *MouseX , int *MouseY)
{
if(MouseItem.Flag){ //�������� ��ġ ����
if(!sinMessageBoxShowFlag){
*MouseX = pCursorPos.x-(MouseItem.w/2);
*MouseY = pCursorPos.y -(MouseItem.h/2);
}
}
if(cMyShop.OpenFlag){
if(MyShopMouseItem.Flag){
*MouseX = pCursorPos.x-(MyShopMouseItem.w/2);
*MouseY = pCursorPos.y -(MyShopMouseItem.h/2);
}
}
///////������ ���̺� ������ �����Ѵ� 10�ʿ� �ѹ� üũ
}
/*----------------------------------------------------------------------------*
* 종료
*-----------------------------------------------------------------------------*/
void cITEM::Close()
{
}
/*----------------------------------------------------------------------------*
* LButtonDown
*-----------------------------------------------------------------------------*/
void cITEM::LButtonDown(int x , int y)
{
/*
if(MouseItem.Flag){ //�������� ��ġ ����
CursorClass = 0; //���콺 Ŀ���� ���ش�
}
else{
CursorClass = 1;
}
*/
}
/*----------------------------------------------------------------------------*
* LButtonUp
*-----------------------------------------------------------------------------*/
void cITEM::LButtonUp(int x , int y)
{
}
/*----------------------------------------------------------------------------*
* RButtonDown
*-----------------------------------------------------------------------------*/
void cITEM::RButtonDown(int x , int y)
{
if(!MouseItem.Flag)
CursorClass = 1; //Default Ŀ���� �����Ѵ�
}
/*----------------------------------------------------------------------------*
* RButtonUp
*-----------------------------------------------------------------------------*/
void cITEM::RButtonUp(int x , int y)
{
}
/*----------------------------------------------------------------------------*
* KeyDown
*-----------------------------------------------------------------------------*/
void cITEM::KeyDown()
{
}
int sinLineCount = 0;
int RedLine[10] = {0,0,0,0,0,0,0,0,0,0};
int SpecialItemLine = 0;
int CountSpecialName = 0; //Ưȭ�� ���� ij���Ϳ� �ش�ɶ� ����Ѵ�
int ItemInfoCol=0; //�������� �ټ�
int UniFlag = 0; //����ũ �������� üũ�Ѵ�
DWORD sinItemKindFlag = 0; //�������� ������ üũ�Ѵ�
sITEMINFO sInfo;
sITEMPRICE sinItemPrice;
int RequireLine[10] = {0,0,0,0,0,0,0,0,0};
int MixItemLine[10] = {0,0,0,0,0,0,0,0,0,0};
int AgingItemLine[10]={0,0,0,0,0,0,0,0,0,0};
int AgingLevel4 = 0;
int QuestItemLine = 0;
int MyShopItemPriceLine = 0;
//�������� ������ �����ش�
int cITEM::ShowItemInfo(sITEM *pItem ,int Flag,int Index)
{
int cnt = 0;
int BlockRate = 0;
int sinSpeed = 0;
int sinAbsorb = 0;
int sinLeftSpot = 0;
int sinRightSpot= 0;
int sinRegen = 0;
char szTemp[64];
char szTemp2[64];
tWeaponClass = 0;
AgingGageFlag = 0;
AgingBarLenght = 0;
AgingLevel4 = 0;
QuestItemLine = 0;
int AgingCnt = 0;
UniFlag = 0; //����ũ �������� üũ�Ѵ�
sinItemKindFlag = 0;
ItemInfoCol=0; //�������� �ټ�
SpecialItemLine = 0; //Ưȭ ������ ���ν��� �� �ʱ�ȭ
if(pItem->Class == ITEM_CLASS_WEAPON_ONE )
tWeaponClass = 1;
if(pItem->Class == ITEM_CLASS_WEAPON_TWO )
tWeaponClass = 2;
if((pItem->sItemInfo.CODE & sinITEM_MASK2) == sinDA1 )
tWeaponClass = 3;
if((pItem->sItemInfo.CODE & sinITEM_MASK2) == sinDA2 ) //�κ�
tWeaponClass = 4;
if((pItem->sItemInfo.CODE & sinITEM_MASK2) == sinOM1 ) //����
tWeaponClass = 4;
for(int t=0;t<10;t++){ //�ʱ�ȭ
RedLine[t] = 0;
RequireLine[t] = 0;
}
for ( int t = 0; t <10; t++ )
{
MixItemLine[t] = 0;
AgingItemLine[t] = 0;
}
sRequire.rDexterity = 0; //�䱸ġ �÷� �ʱ�ȭ
sRequire.rHealth = 0;
sRequire.rLevel = 0;
sRequire.rSpirit = 0;
sRequire.rStrength = 0;
sRequire.rTalent = 0;
memset(&szTemp,0,sizeof(szTemp));
memset(&szTemp2,0,sizeof(szTemp2));
memset(&szInfoBuff,0,sizeof(szInfoBuff));
memset(&szInfoBuff2,0,sizeof(szInfoBuff2));
if(pItem->Class == ITEM_CLASS_WEAPON_TWO && pItem->ItemPosition){ //���ڵ� ���� �ϰ��
memcpy(&sInfo,&cInvenTory.InvenItem[sInven[0].ItemIndex-1].sItemInfo,sizeof(sITEMINFO));
}
else
memcpy(&sInfo,&pItem->sItemInfo,sizeof(sITEMINFO));
#ifdef _LANGUAGE_CHINESE //�ؿ� //�߱� 100�� ������ ǥ�� ����
{
if( sInfo.CODE == (sinWA1|sin20) )
{//Minotaur Axe
strcpy(sInfo.ItemName, ha100LVQuestItemName[0]);
}
if( sInfo.CODE == (sinWC1|sin20) )
{//Extreme Talon
strcpy(sInfo.ItemName, ha100LVQuestItemName[1]);
}
if( sInfo.CODE == (sinWH1|sin21) )
{//Dragon Bone Hammer
strcpy(sInfo.ItemName, ha100LVQuestItemName[2]);
}
if( sInfo.CODE == (sinWM1|sin21) )
{//Gothic Staff
strcpy(sInfo.ItemName, ha100LVQuestItemName[7]);
}
if( sInfo.CODE == (sinWP1|sin21) )
{//Hellfire Scythe
strcpy(sInfo.ItemName, ha100LVQuestItemName[3]);
}
if( sInfo.CODE == (sinWS1|sin22) )
{//Revenge Bow
strcpy(sInfo.ItemName, ha100LVQuestItemName[4]);
}
if( sInfo.CODE == (sinWS2|sin23) )
{//Immortal Sword
strcpy(sInfo.ItemName, ha100LVQuestItemName[5]);
}
if( sInfo.CODE == (sinWT1|sin21) )
{//Salamander Javelin
strcpy(sInfo.ItemName, ha100LVQuestItemName[6]);
}
}
#endif
#ifdef _LANGUAGE_ENGLISH //�ؿ� //���� 100�� ������ ǥ�� ����
{
if( sInfo.CODE == (sinWA1|sin20) )
{//Minotaur Axe
strcpy(sInfo.ItemName, ha100LVQuestItemName[0]);
}
if( sInfo.CODE == (sinWC1|sin20) )
{//Extreme Talon
strcpy(sInfo.ItemName, ha100LVQuestItemName[1]);
}
if( sInfo.CODE == (sinWH1|sin21) )
{//Dragon Bone Hammer
strcpy(sInfo.ItemName, ha100LVQuestItemName[2]);
}
if( sInfo.CODE == (sinWM1|sin21) )
{//Gothic Staff
strcpy(sInfo.ItemName, ha100LVQuestItemName[7]);
}
if( sInfo.CODE == (sinWP1|sin21) )
{//Hellfire Scythe
strcpy(sInfo.ItemName, ha100LVQuestItemName[3]);
}
if( sInfo.CODE == (sinWS1|sin22) )
{//Revenge Bow
strcpy(sInfo.ItemName,ha100LVQuestItemName[4]);
}
if( sInfo.CODE == (sinWS2|sin23) )
{//Immortal Sword
strcpy(sInfo.ItemName, ha100LVQuestItemName[5]);
}
if( sInfo.CODE == (sinWT1|sin21) )
{//Salamander Javelin
strcpy(sInfo.ItemName, ha100LVQuestItemName[6]);
}
//DRZ_EDIT Add new class Quest Weapon here.
}
#endif
#ifdef _LANGUAGE_VEITNAM //�ؿ� //��Ʈ�� 100�� ������ ǥ�� ����
{
if( sInfo.CODE == (sinWA1|sin20) )
{//Minotaur Axe
strcpy(sInfo.ItemName, ha100LVQuestItemName[0]);
}
if( sInfo.CODE == (sinWC1|sin20) )
{//Extreme Talon
strcpy(sInfo.ItemName, ha100LVQuestItemName[1]);
}
if( sInfo.CODE == (sinWH1|sin21) )
{//Dragon Bone Hammer
strcpy(sInfo.ItemName, ha100LVQuestItemName[2]);
}
if( sInfo.CODE == (sinWM1|sin21) )
{//Gothic Staff
strcpy(sInfo.ItemName, ha100LVQuestItemName[7]);
}
if( sInfo.CODE == (sinWP1|sin21) )
{//Hellfire Scythe
strcpy(sInfo.ItemName, ha100LVQuestItemName[3]);
}
if( sInfo.CODE == (sinWS1|sin22) )
{//Revenge Bow
strcpy(sInfo.ItemName, ha100LVQuestItemName[4]);
}
if( sInfo.CODE == (sinWS2|sin23) )
{//Immortal Sword
strcpy(sInfo.ItemName, ha100LVQuestItemName[5]);
}
if( sInfo.CODE == (sinWT1|sin21) )
{//Salamander Javelin
strcpy(sInfo.ItemName, ha100LVQuestItemName[6]);
}
}
#endif
if(sInfo.UniqueItem)
UniFlag = 1; //����ũ ������ �÷�
if(sInfo.ItemKindCode)
sinItemKindFlag = sInfo.ItemKindCode;
//��� ������
if(sInfo.CODE == (sinQT1|sin06)){
sinItemKindFlag = 100;
}
//������ �̸�
if(tWeaponClass)
wsprintf(szInfoBuff,"%s%s\r",sInfo.ItemName," "); //���� �� ����
else
wsprintf(szInfoBuff,"%s\r",sInfo.ItemName);
//���ָӴ��ϰ��
if((sInfo.CODE & sinITEM_MASK2) == sinPZ1 || (sInfo.CODE & sinITEM_MASK2) == sinPZ2){
if(sInfo.PotionCount <= 1){
wsprintf(szInfoBuff,"%s\r",sinLuckyBox);
}
}
lstrcpy(szInfoBuff2,"\r"); //��ĭ �dzʶ�
ItemInfoCol++;
//����¡ �������� ��� ������ ������ �dzʶ�
if(sInfo.ItemKindCode == ITEM_KIND_AGING ){
if(sInfo.ItemAgingCount[1]) AgingGageFlag = 1;
else AgingGageFlag = 2;
lstrcat(szInfoBuff,"\r\r");
lstrcat(szInfoBuff2,"\r\r"); //��ĭ �dzʶ�
ItemInfoCol++;
ItemInfoCol++;
if(sInfo.ItemAgingCount[0]){
AgingBarLenght = (int)((float)((float)125*(((float)sInfo.ItemAgingCount[0]/(float)sInfo.ItemAgingCount[1]))));
}
AgingLevel4 = sInfo.ItemAgingNum[0];
}
if(sInfo.ItemKindCode == ITEM_KIND_QUEST_WEAPON && sInfo.ItemAgingNum[0] < 4 &&
(sInfo.CODE & sinITEM_MASK2) != sinOR2){
lstrcat(szInfoBuff,"\r");
lstrcat(szInfoBuff2,"\r"); //��ĭ
ItemInfoCol++;
wsprintf(szTemp,"%s:%d/%d \r",QuestMonsterName[sInfo.ItemAgingNum[1]],sInfo.ItemAgingCount[1]-sInfo.ItemAgingCount[0],sInfo.ItemAgingCount[1]);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
QuestItemLine = ItemInfoCol;
lstrcat(szInfoBuff,"\r");
lstrcat(szInfoBuff2,"\r"); //��ĭ
ItemInfoCol++;
}
/////////////��ȯ ������
if(pItem->CODE == (sinEC1|sin01)){ //�ʺ������� ����
lstrcpy(szTemp,TownName[0]);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(pItem->CODE == (sinEC1|sin02)){ //�ʺ������� ����
lstrcpy(szTemp,TownName[1]);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(pItem->CODE == (sinEC1|sin04)){ //��������
lstrcpy(szTemp,TownName[2]);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//TEST
/*
char szTestLinkCore[32];
memcpy(szTestLinkCore,"��ũ �ھ� �̹����������",32);
szTestLinkCore[9]=0;
char szLinkName[24];
int len = lstrlen(szTestLinkCore);
if(szTestLinkCore[len+1] != NULL){
lstrcpy(szLinkName,&szTestLinkCore[len+1]);
lstrcpy(szTemp,szLinkName);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
*/
if(pItem->CODE == (sinGP1|sin10) || pItem->CODE == (sinGP1|sin22) ){ //Ŭ�� ũ����Ż // pluto ����� �����
lstrcpy(szTemp,ClanCristalName);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
//��ũ�ھ� �̸����� ij���� �̸��� ����
int len = lstrlen(pItem->sItemInfo.ItemName);
char szLinkName[24];
if(pItem->CODE == (sinEC1|sin05)){ //��ũ�ھ�
lstrcpy(szTemp,LinkCoreName);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if(pItem->sItemInfo.ItemName[len+1] != NULL){
//�������� ��ĭ�dzʶ�
lstrcat(szInfoBuff,"\r");
lstrcat(szInfoBuff2,"\r"); //��ĭ �dzʶ�
ItemInfoCol++;
lstrcpy(szLinkName,&pItem->sItemInfo.ItemName[len+1]);
lstrcpy(szTemp,szLinkName);
lstrcat(szInfoBuff,DesLinkCore); //���: �̶�� �ٿ��ش�
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff,szTemp2); //�̸��ڿ� \r�� �����Ƿ� �ϳ��ٿ��ش�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
/* �ƽ����� ������ ����ߵ� -_-
if(sInfo.CODE == (sinQT1|sin06)){
lstrcpy(szTemp,VampOption[0]);
wsprintf(szTemp2,"%d%s\r",50,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
lstrcpy(szTemp,VampOption[1]);
wsprintf(szTemp2,"%d%s\r",20,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
lstrcpy(szTemp,VampOption[2]);
wsprintf(szTemp2,"%d%s\r",15,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
sinRegen = (int)(1.6f*10.001f);
sinRightSpot = sinRegen %10; //�Ҽ��� ���ڸ���
sinLeftSpot = (sinRegen - sinRightSpot)/10;
lstrcpy(szTemp,VampOption[3]);
wsprintf(szTemp2,"%d.%d\r",sinLeftSpot,sinRightSpot);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
lstrcpy(szTemp,VampOption[4]);
wsprintf(szTemp2,"%d%s\r",3,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
*/
if(sInfo.Damage[0] || sInfo.Damage[1]){ //���ݷ� ����ġ
lstrcpy(szTemp,sinAbilityName[0]);
wsprintf(szTemp2,"%d-%d\r",sInfo.Damage[0],sInfo.Damage[1]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_DAMAGE_MIN)!=0 ||
(sInfo.ItemKindMask & SIN_ADD_DAMAGE_MAX)!=0 ){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
//����¡ ����
if(sInfo.ItemAgingNum[0]){
if((sInfo.CODE & sinITEM_MASK2)==sinWA1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWC1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWH1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWM1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWP1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWS1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWS2 ||
(sInfo.CODE & sinITEM_MASK2)==sinWT1 )
AgingItemLine[AgingCnt++] = ItemInfoCol;
}
}
if(sInfo.Attack_Speed){
lstrcpy(szTemp,sinAbilityName[1]);
if(CheckQuestItemDownFlag && sInfo.ItemKindCode == ITEM_KIND_QUEST_WEAPON){
wsprintf(szTemp2,"%d\r",sInfo.Attack_Speed-2);
RedLine[9] = ItemInfoCol+1;
}
else{
wsprintf(szTemp2,"%d\r",sInfo.Attack_Speed);
}
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_ATTACK_SPEED)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
if(sInfo.Shooting_Range){
lstrcpy(szTemp,sinAbilityName[2]);
wsprintf(szTemp2,"%d\r",sInfo.Shooting_Range);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
/*
if((sInfo.ItemKindMask & SIN_ADD_ATTACK_SPEED)!=0){
for(cnt = 0; cnt <10; cnt++)
if(!MixItemLine[cnt])MixItemLine[cnt] = ItemInfoCol;
}
*/
//����¡ ����
/*
if(sInfo.ItemAgingNum[0]){
if((sInfo.CODE & sinITEM_MASK2)==sinWS1||
(sInfo.CODE & sinITEM_MASK2)==sinWT1)
AgingItemLine[AgingCnt++] = ItemInfoCol;
}
*/
}
if(sInfo.Critical_Hit){
lstrcpy(szTemp,sinAbilityName[3]);
wsprintf(szTemp2,"%d%s\r",sInfo.Critical_Hit,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_CRITICAL)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
//����¡ ����
if(sInfo.ItemAgingNum[0]){
if( (sInfo.CODE & sinITEM_MASK2)==sinWC1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWP1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWS1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWT1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWS2 )
AgingItemLine[AgingCnt++] = ItemInfoCol;
}
}
//��� ����
if(sInfo.Defence){
lstrcpy(szTemp,sinAbilityName[4]);
wsprintf(szTemp2,"%d\r",sInfo.Defence);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_DEFENCE)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
//����¡ ����
if(sInfo.ItemAgingNum[0]){
if( (sInfo.CODE & sinITEM_MASK2)==sinOM1 ||
(sInfo.CODE & sinITEM_MASK2)==sinDA1 ||
(sInfo.CODE & sinITEM_MASK2)==sinDA2 ||
(sInfo.CODE & sinITEM_MASK2)==sinDB1 || // ����� - ����¡ ������ �߰�(����)
(sInfo.CODE & sinITEM_MASK2)==sinDG1 || // ����� - ����¡ ������ �߰�(�尩)
(sInfo.CODE & sinITEM_MASK2)==sinOA2 ){ // ����� - ����¡ ������ �߰�(�ϸ�)
AgingItemLine[AgingCnt++] = ItemInfoCol;
}
}
}
if(sInfo.Attack_Rating){
lstrcpy(szTemp,sinAbilityName[5]);
wsprintf(szTemp2,"%d\r",sInfo.Attack_Rating);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_ATTACK_RATE)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
//����¡ ����
if(sInfo.ItemAgingNum[0]){
if((sInfo.CODE & sinITEM_MASK2)==sinWA1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWC1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWM1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWH1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWP1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWS2 ||
(sInfo.CODE & sinITEM_MASK2)==sinOA2 ){ // ����� - ����¡ ������ �߰�(�ϸ�)
AgingItemLine[AgingCnt++] = ItemInfoCol;
}
}
}
if(sInfo.fAbsorb){
//sinAbsorb = (int)(sInfo.fAbsorb*10.001f);
sinAbsorb = (int)(GetItemAbsorb(&sInfo)*10.001f);
sinRightSpot = sinAbsorb %10; //�Ҽ��� ���ڸ���
sinLeftSpot = (sinAbsorb - sinRightSpot)/10;
lstrcpy(szTemp,sinAbilityName[6]);
wsprintf(szTemp2,"%d.%d\r",sinLeftSpot,sinRightSpot);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_ABSORB)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
if(sInfo.ItemAgingNum[0]){
if( (sInfo.CODE & sinITEM_MASK2)==sinOM1 ||
(sInfo.CODE & sinITEM_MASK2)==sinDA1 ||
(sInfo.CODE & sinITEM_MASK2)==sinDS1 ||
(sInfo.CODE & sinITEM_MASK2)==sinDA2 ||
(sInfo.CODE & sinITEM_MASK2)==sinDB1 || // ����� - ����¡ ������ �߰�(����)
(sInfo.CODE & sinITEM_MASK2)==sinDG1 ){ // ����� - ����¡ ������ �߰�(�尩)
AgingItemLine[AgingCnt++] = ItemInfoCol;
}
}
}
if(sInfo.fBlock_Rating){
BlockRate = (int)(sInfo.fBlock_Rating);
lstrcpy(szTemp,sinAbilityName[7]);
wsprintf(szTemp2,"%d%s\r",BlockRate,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_BLOCK_RATE)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
//����¡ ����
if(sInfo.ItemAgingNum[0]){
if( (sInfo.CODE & sinITEM_MASK2)==sinDS1)
AgingItemLine[AgingCnt++] = ItemInfoCol;
}
}
//�̵� ����
if(sInfo.fSpeed){
sinSpeed = (int)(sInfo.fSpeed *10.001f);
sinRightSpot = sinSpeed %10; //�Ҽ��� ���ڸ���
sinLeftSpot = (sinSpeed - sinRightSpot)/10;
lstrcpy(szTemp,sinAbilityName[8]);
wsprintf(szTemp2,"%d.%d\r",sinLeftSpot,sinRightSpot);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_MOVE_SPEED)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
if(sInfo.Durability[0] || sInfo.Durability[1]){ //������ ����ġ
lstrcpy(szTemp,sinAbilityName[9]);
wsprintf(szTemp2,"%d/%d\r",sInfo.Durability[0],sInfo.Durability[1]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if(sInfo.ItemAgingNum[0]){
if((sInfo.CODE & sinITEM_MASK2)==sinWA1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWH1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWS1 ||
(sInfo.CODE & sinITEM_MASK2)==sinDS1 ||
(sInfo.CODE & sinITEM_MASK2)==sinOM1 ||
(sInfo.CODE & sinITEM_MASK2)==sinDA1 ||
(sInfo.CODE & sinITEM_MASK2)==sinDA2 ||
(sInfo.CODE & sinITEM_MASK2)==sinDB1 || // ����� - ����¡ ������ �߰�(����)
(sInfo.CODE & sinITEM_MASK2)==sinDG1 || // ����� - ����¡ ������ �߰�(�尩)
(sInfo.CODE & sinITEM_MASK2)==sinOA2 ){ // ����� - ����¡ ������ �߰�(�ϸ�)
AgingItemLine[AgingCnt++] = ItemInfoCol;
}
}
}
//ȸ����
if(sInfo.Mana[0] || sInfo.Mana[1]){
lstrcpy(szTemp,sinAbilityName[10]);
wsprintf(szTemp2,"%d-%d\r",sInfo.Mana[0],sInfo.Mana[1]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.Life[0] || sInfo.Life[1]){
lstrcpy(szTemp,sinAbilityName[11]);
wsprintf(szTemp2,"%d-%d\r",sInfo.Life[0],sInfo.Life[1]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.Stamina[0] || sInfo.Stamina[1]){
lstrcpy(szTemp,sinAbilityName[12]);
wsprintf(szTemp2,"%d-%d\r",sInfo.Stamina[0],sInfo.Stamina[1]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//����
if(sInfo.Resistance[0]){
lstrcpy(szTemp,sinAbilityName[13]);
wsprintf(szTemp2,"%d\r",sInfo.Resistance[0]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_BIO)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
if(sInfo.Resistance[1]){
lstrcpy(szTemp,sinAbilityName[14]);
wsprintf(szTemp2,"%d\r",sInfo.Resistance[1]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.Resistance[2]){
lstrcpy(szTemp,sinAbilityName[15]);
wsprintf(szTemp2,"%d\r",sInfo.Resistance[2]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_FIRE)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
if(sInfo.Resistance[3]){
lstrcpy(szTemp,sinAbilityName[16]);
wsprintf(szTemp2,"%d\r",sInfo.Resistance[3]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_ICE)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
if(sInfo.Resistance[4]){
lstrcpy(szTemp,sinAbilityName[17]);
wsprintf(szTemp2,"%d\r",sInfo.Resistance[4]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_LIGHTNING)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
if(sInfo.Resistance[5]){
lstrcpy(szTemp,sinAbilityName[18]);
wsprintf(szTemp2,"%d\r",sInfo.Resistance[5]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_POISON)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
if(sInfo.Resistance[6]){
lstrcpy(szTemp,sinAbilityName[19]);
wsprintf(szTemp2,"%d\r",sInfo.Resistance[6]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.Resistance[7]){
lstrcpy(szTemp,sinAbilityName[20]);
wsprintf(szTemp2,"%d\r",sInfo.Resistance[7]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.fLife_Regen && (sInfo.CODE & sinITEM_MASK2) != sinFO1){
sinRegen = (int)(sInfo.fLife_Regen*10.001f);
sinRightSpot = sinRegen %10; //�Ҽ��� ���ڸ���
sinLeftSpot = (sinRegen - sinRightSpot)/10;
lstrcpy(szTemp,sinAbilityName[21]);
wsprintf(szTemp2,"%d.%d\r",sinLeftSpot,sinRightSpot);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_LIFEREGEN)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
if(sInfo.fMana_Regen && (sInfo.CODE & sinITEM_MASK2) != sinFO1){
sinRegen = (int)(sInfo.fMana_Regen*10.001f);
sinRightSpot = sinRegen %10; //�Ҽ��� ���ڸ���
sinLeftSpot = (sinRegen - sinRightSpot)/10;
lstrcpy(szTemp,sinAbilityName[22]);
wsprintf(szTemp2,"%d.%d\r",sinLeftSpot,sinRightSpot);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_MANAREGEN)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
if(sInfo.fStamina_Regen && (sInfo.CODE & sinITEM_MASK2) != sinFO1){
sinRegen = (int)(sInfo.fStamina_Regen*10.001f);
sinRightSpot = sinRegen %10; //�Ҽ��� ���ڸ���
sinLeftSpot = (sinRegen - sinRightSpot)/10;
lstrcpy(szTemp,sinAbilityName[23]);
wsprintf(szTemp2,"%d.%d\r",sinLeftSpot,sinRightSpot);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_STAMINAREGEN)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
int AddState;
if(sInfo.fIncrease_Life){
AddState = (int)sInfo.fIncrease_Life;
lstrcpy(szTemp,sinAbilityName[24]);
wsprintf(szTemp2,"%d\r",AddState);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_LIFE)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
if(sInfo.fIncrease_Mana){
AddState = (int)sInfo.fIncrease_Mana;
lstrcpy(szTemp,sinAbilityName[25]);
wsprintf(szTemp2,"%d\r",AddState);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_MANA)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
//����¡ ����
if(sInfo.ItemAgingNum[0]){
if((sInfo.CODE & sinITEM_MASK2)==sinWM1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWS1 ||
(sInfo.CODE & sinITEM_MASK2)==sinWT1){
AgingItemLine[AgingCnt++] = ItemInfoCol;
}
}
}
if(sInfo.fIncrease_Stamina){
AddState = (int)sInfo.fIncrease_Stamina;
lstrcpy(szTemp,sinAbilityName[26]);
wsprintf(szTemp2,"%d\r",AddState);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if((sInfo.ItemKindMask & SIN_ADD_STAMINA)!=0){
for(cnt = 0; cnt <10; cnt++){
if(!MixItemLine[cnt]){
MixItemLine[cnt] = ItemInfoCol;
break;
}
}
}
}
if(sInfo.Potion_Space){
lstrcpy(szTemp,sinAbilityName[27]);
wsprintf(szTemp2,"%d\r",sInfo.Potion_Space);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//�䱸ġ
int i = 0;
if(sInfo.Level){
lstrcpy(szTemp,sinAbilityName[28]);
if((sInfo.CODE & sinITEM_MASK2) == sinFO1){
lstrcat(szInfoBuff,"\r");
lstrcat(szInfoBuff2,"\r"); //��ĭ �dzʶ�
ItemInfoCol++;
for( i = 0; i < 12 ; i++){ // ����� : ��� ���� �߰��� ���� ���� 12�� ����
if( ((pItem->CODE&sinITEM_MASK3)== SheltomCode2[i]) ) // ����� - �Ϲ� ���� �߰�
{
if(i <= 3){
wsprintf(szTemp2,"%d-%d\r",ForceOrbUseLevel[i][0],ForceOrbUseLevel[i][1]);
}
else{
wsprintf(szTemp2,"%d+\r",ForceOrbUseLevel[i][0]);
}
break;
}
else if(((pItem->CODE&sinITEM_MASK3)== MagicSheltomCode[i])) // ����� - ���� ����(��� ����)
{
if(i <= 3){
wsprintf(szTemp2,"%d-%d\r",MagicForceOrbUseLevel[i][0],MagicForceOrbUseLevel[i][1]);
}
else{
wsprintf(szTemp2,"%d+\r",MagicForceOrbUseLevel[i][0]);
}
break;
}
else if( ( (pItem->CODE&sinITEM_MASK3)== BillingMagicSheltomCode[i]) ) // ����� - ��� ���� ���� �߰�
{
wsprintf(szTemp2,"%d+\r",BillingMagicForceOrbUseLevel[i][0]);
break;
}
}
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RequireLine[0] = ItemInfoCol;
if(sinChar->Level < ForceOrbUseLevel[i][0] ||
sinChar->Level > ForceOrbUseLevel[i][1]){
sRequire.rLevel = 1;
RedLine[0]=ItemInfoCol;
}
}
else{
wsprintf(szTemp2,"%d\r",sInfo.Level);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RequireLine[0] = ItemInfoCol;
if(sInfo.Level >sinChar->Level){
sRequire.rLevel = 1;
RedLine[0]=ItemInfoCol;
}
}
}
//��������
if((sInfo.CODE & sinITEM_MASK2) == sinFO1){
for( i = 0; i < 12 ; i++){ // ����� : ��� ���� �߰��� ���� ���� 12�� ����
if((pItem->CODE&sinITEM_MASK3)== SheltomCode2[i]){
lstrcpy(szTemp,sinAddDamageItem);
wsprintf(szTemp2,"%d\r",ForceOrbDamage[i]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
// ����� : ��� ���� �߰�
if(i>5 && i<10){ // ����� : ��� ���� �߰�(��Ű, �����, �췹����, �̶��� ������ ��� ���ݷ� ���� 10%�� �� �ٿ��ش�)
lstrcpy(szTemp,AddPercentDamage3);
wsprintf(szTemp2,"%d%s\r",10,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
else if(i==10){ // ����� : ��� ���� �߰�(���丣�� ������ ��� ���ݷ� ���� 15%�� �� �ٿ��ش�)
lstrcpy(szTemp,AddPercentDamage3);
wsprintf(szTemp2,"%d%s\r",15,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
else if(i==11){ // ����� : ��� ���� �߰�(�̴ϱ� ������ ��� ���ݷ� ���� 20%�� �� �ٿ��ش�)
lstrcpy(szTemp,AddPercentDamage3);
wsprintf(szTemp2,"%d%s\r",20,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
lstrcpy(szTemp,sinContinueTimeItem);
wsprintf(szTemp2,"%d%s\r",ForceOrbUseTime[i],SecName);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
break;
}
else if((pItem->CODE&sinITEM_MASK3)== MagicSheltomCode[i]) // ����� - ���� ���� �߰�
{
lstrcpy(szTemp,sinAddDamageItem);
wsprintf(szTemp2,"%d\r",MagicForceOrbDamage[i]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
// ����� - ���� ���� �߰�
if(i>5 && i<10){ // ����� - ���� ���� �߰�(��Ű, �����, �췹����, �̶��� ������ ��� ���ݷ� ���� 10%�� �� �ٿ��ش�)
lstrcpy(szTemp,AddPercentDamage3);
wsprintf(szTemp2,"%d%s\r",10,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
else if(i==10){ // ����� - ���� ���� �߰�(���丣�� ������ ��� ���ݷ� ���� 15%�� �� �ٿ��ش�)
lstrcpy(szTemp,AddPercentDamage3);
wsprintf(szTemp2,"%d%s\r",15,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
else if(i==11){ // ����� - ���� ���� �߰�(�̴ϱ� ������ ��� ���ݷ� ���� 20%�� �� �ٿ��ش�)
lstrcpy(szTemp,AddPercentDamage3);
wsprintf(szTemp2,"%d%s\r",20,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
lstrcpy(szTemp,sinContinueTimeItem);
wsprintf(szTemp2,"%d%s\r",MagicForceOrbUseTime[i],SecName);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
break;
}
else if((pItem->CODE&sinITEM_MASK3)== BillingMagicSheltomCode[i]) // ����� - ��� ���� ���� �߰�
{
// ����� - ��� ���� ���� �߰�(���ݷ� ���� 15%�� �� �ٿ��ش�)
lstrcpy(szTemp,AddPercentDamage3);
wsprintf(szTemp2,"%d%s\r",15,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
lstrcpy(szTemp,sinContinueTimeItem);
wsprintf(szTemp2,"%d%s\r",BillingMagicForceOrbUseTime[i],SecName);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
break;
}
}
}
//�Ѻ��̺�Ʈ ��Ʈ //Kyle����
//14��
if(pItem->sItemInfo.CODE == (sinDA1|sin48) || pItem->sItemInfo.CODE == (sinDA2|sin48))
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*14)-(NowTime-pItem->sItemInfo.dwCreateTime);
lstrcpy(szTemp,sinContinueTimeItem);
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//�� �� �� : �����, �ۼ��� : 08.04.07
//�� �� : Ŭ��ġ���� ����
//�����Ⱓ : 5��
//if((sInfo.CODE & sinITEM_MASK2) == sin06)
if(pItem->sItemInfo.CODE == (sinOR2|sin06) || pItem->sItemInfo.CODE == (sinOR2|sin07) ||
pItem->sItemInfo.CODE == (sinOR2|sin08) || pItem->sItemInfo.CODE == (sinOR2|sin09) ||
pItem->sItemInfo.CODE == (sinOR2|sin10) || pItem->sItemInfo.CODE == (sinOR2|sin11) ||
pItem->sItemInfo.CODE == (sinOR2|sin12) || pItem->sItemInfo.CODE == (sinOR2|sin13) ||
pItem->sItemInfo.CODE == (sinOR2|sin14) || pItem->sItemInfo.CODE == (sinOR2|sin15) ||
pItem->sItemInfo.CODE == (sinOR2|sin16) || pItem->sItemInfo.CODE == (sinOR2|sin17) ||
pItem->sItemInfo.CODE == (sinOR2|sin18) || pItem->sItemInfo.CODE == (sinOR2|sin19) ||
pItem->sItemInfo.CODE == (sinOR2|sin20) || pItem->sItemInfo.CODE == (sinOR2|sin21) ||
pItem->sItemInfo.CODE == (sinOR2|sin22) || pItem->sItemInfo.CODE == (sinOR2|sin23) ||
pItem->sItemInfo.CODE == (sinOR2|sin24) || pItem->sItemInfo.CODE == (sinOR2|sin25))
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*5)-(NowTime-pItem->sItemInfo.dwCreateTime);
lstrcpy(szTemp,sinContinueTimeItem);
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//�� �� �� : �����, �ۼ��� : 09.12.08
//�� �� : ��Ÿ ��, ��Ÿ �ƹķ� �Ⱓ���� ����
//�����Ⱓ : 3��
if( pItem->sItemInfo.CODE == (sinOR2|sin27) || pItem->sItemInfo.CODE == (sinOA1|sin32) ) // ��Ÿ ��, �ƹķ�
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*3)-(NowTime-pItem->sItemInfo.dwCreateTime);
// DWORD Time = 0; // ����� : ��Ÿ��, ��Ÿ�ƹķ��� �ͽ��ĵǸ鼭 �ð��� �ʱ�ȭ �Ǿ� ������ ������Ű�� ����. �����ð� 0���� ǥ��
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r",ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//�� �� �� : �����, �ۼ��� : 09.07.31
//�� �� : �̺�Ʈ ��, �̺�Ʈ �ƹķ� �Ⱓ���� ����
//�����Ⱓ : 7��
if( pItem->sItemInfo.CODE == (sinOR2|sin28) || pItem->sItemInfo.CODE == (sinOA1|sin33) ) // �̺�Ʈ ��, �ƹķ�
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*7)-(NowTime-pItem->sItemInfo.dwCreateTime); // 7�Ϸ� ����
//DWORD Time = 0; // ����� - �̺�Ʈ��, �̺�Ʈ�ƹķ� ������ ������Ű�� ����. �����ð� 0���� ǥ��
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r",ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2);
// wsprintf(szTemp2,"%d%s%d%s\r",(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //1�Ϸ� ������
// wsprintf(szTemp2,"%d%s\r",(Time/60)%60,sinMinute2); // 1���� ������
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//�� �� �� : �����, �ۼ��� : 09.12.17
//�� �� : �̺�Ʈ ��, �̺�Ʈ �ƹķ� �Ⱓ���� ����
//�����Ⱓ : 1�ð�
if( pItem->sItemInfo.CODE == (sinOR2|sin29) || pItem->sItemInfo.CODE == (sinOA1|sin34) ) // �̺�Ʈ ��, �ƹķ�
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60)-(NowTime-pItem->sItemInfo.dwCreateTime); // 1���� ����
//DWORD Time = 0; // ����� - �̺�Ʈ��, �̺�Ʈ�ƹķ� ������ ������Ű�� ����. �����ð� 0���� ǥ��
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r",ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
// wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); // 1�� �̻� ������
// wsprintf(szTemp2,"%d%s%d%s\r",(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //1�Ϸ� ������
wsprintf(szTemp2,"%d%s\r",(Time/60)%60,sinMinute2); // 1���� ������
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//�� �� �� : �����, �ۼ��� : 09.12.17
//�� �� : �̺�Ʈ ��, �̺�Ʈ �ƹķ� �Ⱓ���� ����
//�����Ⱓ : 1��
if( pItem->sItemInfo.CODE == (sinOR2|sin30) || pItem->sItemInfo.CODE == (sinOA1|sin35) ) // �̺�Ʈ ��, �ƹķ�
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24)-(NowTime-pItem->sItemInfo.dwCreateTime); // 1�Ϸ� ����
//DWORD Time = 0; // ����� - �̺�Ʈ��, �̺�Ʈ�ƹķ� ������ ������Ű�� ����. �����ð� 0���� ǥ��
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r",ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
// wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); // 1�� �̻� ������
wsprintf(szTemp2,"%d%s%d%s\r",(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //1�Ϸ� ������
// wsprintf(szTemp2,"%d%s\r",(Time/60)%60,sinMinute2); // 1���� ������
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//�� �� �� : �庰, �ۼ��� : 10.02.02
//�� �� : ��Ʈ��(�߷�Ÿ�� �̺�Ʈ) �Ⱓ���� ����
//�����Ⱓ : 7��
if( pItem->sItemInfo.CODE == (sinOR2|sin33) )
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*7)-(NowTime-pItem->sItemInfo.dwCreateTime); // 7�Ϸ� ����
//DWORD Time = 0; //
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r",ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2);
// wsprintf(szTemp2,"%d%s%d%s\r",(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //1�Ϸ� ������
// wsprintf(szTemp2,"%d%s\r",(Time/60)%60,sinMinute2); // 1���� ������
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//�� �� �� : �庰, �ۼ��� : 10.02.09
//�� �� : ���� ����� �Ⱓ���� ����
//�����Ⱓ : 7��
if( pItem->sItemInfo.CODE == (sinOA1|sin36) ) // ������ �����
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*7)-(NowTime-pItem->sItemInfo.dwCreateTime); // 7�Ϸ� ����
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r",ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
// �庰 - ĵ������
//�� �� �� : �庰, �ۼ��� : 10.02.24
//�� �� : ��Ʈ�ƹķ�(ĵ������) �Ⱓ���� ����
//�����Ⱓ : 7��
if( pItem->sItemInfo.CODE == (sinOA1|sin37) )
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*7)-(NowTime-pItem->sItemInfo.dwCreateTime); // 7�Ϸ� ����
//DWORD Time = 0; //
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r",ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2);
// wsprintf(szTemp2,"%d%s%d%s\r",(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //1�Ϸ� ������
// wsprintf(szTemp2,"%d%s\r",(Time/60)%60,sinMinute2); // 1���� ������
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
// �庰 - ���ǵ� ����(1��)
if( pItem->sItemInfo.CODE == (sinDB1|sin33) )
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*1)-(NowTime-pItem->sItemInfo.dwCreateTime);
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r", ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
// �庰 - ���ǵ� ����(1�ð�)
if( pItem->sItemInfo.CODE == (sinDB1|sin34) )
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60)-(NowTime-pItem->sItemInfo.dwCreateTime);
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r", ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
// �庰 - ���� �ϸ�(1��)
if( pItem->sItemInfo.CODE == (sinOA2|sin33) )
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*1)-(NowTime-pItem->sItemInfo.dwCreateTime);
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r", ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
// �庰 - ���� �ϸ�(1�ð�)
if( pItem->sItemInfo.CODE == (sinOA2|sin34) )
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60)-(NowTime-pItem->sItemInfo.dwCreateTime);
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r", ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
// �庰 - �ҿコ��
//�����Ⱓ : 7��
if( pItem->sItemInfo.CODE == (sinOR2|sin36) || pItem->sItemInfo.CODE == (sinOR2|sin37) ||
pItem->sItemInfo.CODE == (sinOR2|sin38) || pItem->sItemInfo.CODE == (sinOR2|sin39) ||
pItem->sItemInfo.CODE == (sinOR2|sin40) )
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*7)-(NowTime-pItem->sItemInfo.dwCreateTime); // 7�Ϸ� ����
//DWORD Time = 0; //
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r",ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2);
// wsprintf(szTemp2,"%d%s%d%s\r",(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //1�Ϸ� ������
// wsprintf(szTemp2,"%d%s\r",(Time/60)%60,sinMinute2); // 1���� ������
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
// �庰 - �ҿコ��
//�����Ⱓ : 14��
if( pItem->sItemInfo.CODE == (sinOA1|sin39) || pItem->sItemInfo.CODE == (sinOA1|sin40) ||
pItem->sItemInfo.CODE == (sinOA1|sin41) || pItem->sItemInfo.CODE == (sinOA1|sin42) )
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*14)-(NowTime-pItem->sItemInfo.dwCreateTime); // 7�Ϸ� ����
//DWORD Time = 0; //
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r",ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2);
// wsprintf(szTemp2,"%d%s%d%s\r",(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //1�Ϸ� ������
// wsprintf(szTemp2,"%d%s\r",(Time/60)%60,sinMinute2); // 1���� ������
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
// �庰 - ���� �̺�Ʈ �̺�Ʈ �ƹķ�, ��
//�����Ⱓ : 14��
if( pItem->sItemInfo.CODE == (sinOR2|sin34) || pItem->sItemInfo.CODE == (sinOR2|sin35) ||
pItem->sItemInfo.CODE == (sinOA1|sin38) )
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*14)-(NowTime-pItem->sItemInfo.dwCreateTime);
//DWORD Time = 0; //
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r",ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2);
// wsprintf(szTemp2,"%d%s%d%s\r",(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //1�Ϸ� ������
// wsprintf(szTemp2,"%d%s\r",(Time/60)%60,sinMinute2); // 1���� ������
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//��Ƽ�� �ڽ�Ƭ
//7��
if(pItem->sItemInfo.CODE == (sinDA1|sin31) || pItem->sItemInfo.CODE == (sinDA2|sin31) ||
pItem->sItemInfo.CODE == (sinDA1|sin33) || pItem->sItemInfo.CODE == (sinDA2|sin33) ||
pItem->sItemInfo.CODE == (sinDA1|sin35) || pItem->sItemInfo.CODE == (sinDA2|sin35) ||
pItem->sItemInfo.CODE == (sinDA1|sin37) || pItem->sItemInfo.CODE == (sinDA2|sin37) ||
pItem->sItemInfo.CODE == (sinDA1|sin39) || pItem->sItemInfo.CODE == (sinDA2|sin39) ||
pItem->sItemInfo.CODE == (sinDA1|sin41) || pItem->sItemInfo.CODE == (sinDA2|sin41) ||
pItem->sItemInfo.CODE == (sinDA1|sin43) || pItem->sItemInfo.CODE == (sinDA2|sin43) ||
pItem->sItemInfo.CODE == (sinDA1|sin45) || pItem->sItemInfo.CODE == (sinDA2|sin45) ||
pItem->sItemInfo.CODE == (sinDB1|sin31) || // ����� - ���ǵ� ����(7��) �߰�
pItem->sItemInfo.CODE == (sinOA2|sin31) || // ����� - ���� �ϸ�(7��) �߰�
pItem->sItemInfo.CODE == (sinOR2|sin31) || // ����� - ���� ���� �� �߰�(�ٺ�)
pItem->sItemInfo.CODE == (sinOR2|sin32) ) // ����� - ���� ���� �� �߰�(ǻ��)
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*7)-(NowTime-pItem->sItemInfo.dwCreateTime);
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r", ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//30��
if(pItem->sItemInfo.CODE == (sinDA1|sin32) || pItem->sItemInfo.CODE == (sinDA2|sin32) ||
pItem->sItemInfo.CODE == (sinDA1|sin34) || pItem->sItemInfo.CODE == (sinDA2|sin34) ||
pItem->sItemInfo.CODE == (sinDA1|sin36) || pItem->sItemInfo.CODE == (sinDA2|sin36) ||
pItem->sItemInfo.CODE == (sinDA1|sin38) || pItem->sItemInfo.CODE == (sinDA2|sin38) ||
pItem->sItemInfo.CODE == (sinDA1|sin40) || pItem->sItemInfo.CODE == (sinDA2|sin40) ||
pItem->sItemInfo.CODE == (sinDA1|sin42) || pItem->sItemInfo.CODE == (sinDA2|sin42) ||
pItem->sItemInfo.CODE == (sinDA1|sin44) || pItem->sItemInfo.CODE == (sinDA2|sin44) ||
pItem->sItemInfo.CODE == (sinDA1|sin46) || pItem->sItemInfo.CODE == (sinDA2|sin46) ||
pItem->sItemInfo.CODE == (sinDA1|sin54) || pItem->sItemInfo.CODE == (sinDA2|sin54) || // ����� - ������ ���� �߰�(����)
pItem->sItemInfo.CODE == (sinDA1|sin55) || pItem->sItemInfo.CODE == (sinDA2|sin55) || // ����� - ������ ���� �߰�(����)
pItem->sItemInfo.CODE == (sinDB1|sin32) || // ����� - ���ǵ� ����(30��) �߰�
pItem->sItemInfo.CODE == (sinOA2|sin32) || // ����� - ���� �ϸ�(30��) �߰�
pItem->sItemInfo.CODE == (sinSP1|sin34) ) // ����� - ȣ���� ĸ��(30��) �߰�
{
DWORD NowTime = GetPlayTime_T();
DWORD Time = (60*60*24*30)-(NowTime-pItem->sItemInfo.dwCreateTime);
lstrcpy(szTemp,sinContinueTimeItem);
if( DeleteEventItem_TimeOut( &pItem->sItemInfo )==TRUE ) // ������ �����Ⱓ�� 0�� ���� ����� �������� �ٽ� �ð��� �þ�� ���� ������.
wsprintf(szTemp2,"%s\r", ExpireItem); // ������ �Ⱓ�� ����Ǿ��� ��� �Ⱓ���� ������ �ѷ��ش�.
else
wsprintf(szTemp2,"%d%s%d%s%d%s\r",(Time/60/60)/24,sinDay4,(Time/60/60)%24,sinHour4,(Time/60)%60,sinMinute2); //
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//�����̾� ����ȭ ������
if((sInfo.CODE & sinITEM_MASK2) == sinBI1 ){
for(int i=0;i<7;i++){
if(pItem->CODE==dwPremiumItemCode[i]){
lstrcpy(szTemp,PremiumItemDoc[i][0]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
lstrcpy(szTemp,PremiumItemDoc[i][1]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
break;
}
}
}
//haGoon �籸�� ������
if((sInfo.CODE & sinITEM_MASK2) == sinSE1){
for(int i=0;i<MAX_SEEL_COUNT;i++){ // ����� - ���̿��� �� �߰� (3���� -> 4����) ������ ���� ���
if(pItem->CODE==sReconItem[i].dwCODE){
lstrcpy(szTemp,sinAbilityName[28]);
wsprintf(szTemp2,"%d-%d\r",sReconItem[i].iLevel[0],sReconItem[i].iLevel[1]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
}
}
//haGoon ������ ������
if((sInfo.CODE & sinITEM_MASK2) == sinBC1){
for( i = 0; i < 16 ; i++){
if((pItem->CODE&sinITEM_MASK3)== dwCastlItemCODE[i]){
//������ ����
if(i==5 || i==6 || i==7){
lstrcpy(szTemp,CastlItemInfo[5]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
lstrcpy(szTemp,CastlItemInfo2[5]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
wsprintf(szTemp,AttributeTower[3],60);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
lstrcpy(szTemp,AttributeTower[i-5]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RedLine[1]=ItemInfoCol;
break;
}
else if(i > 7){
lstrcpy(szTemp,CastlItemInfo[6]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
lstrcpy(szTemp,CastlItemInfo2[6]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
wsprintf(szTemp,AttributeTower[3],60);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
lstrcpy(szTemp,CharClassTarget[i-8]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RedLine[1]=ItemInfoCol;
break;
}
else{
lstrcpy(szTemp,CastlItemInfo[i]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
lstrcpy(szTemp,CastlItemInfo2[i]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if(i<3){
wsprintf(szTemp,AttributeTower[3],30);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
break;
}
}
}
}
// ����� - �ν��� ������(�����, ���, �ٷ�)
if((sInfo.CODE & sinITEM_MASK2) == sinBC1)
{
for( i = 0; i < 9 ; i++) // ���� �ν��� �������� 9������ �߰��Ǿ���.
{
if((pItem->CODE&sinITEM_MASK3)== dwBoosterItemCode[i])
{
int m,n=0;
if(i>=0 && i<=2) m=0; // �����
if(i>=3 && i<=5) m=1; // ���
if(i>=6 && i<=8) m=2; // �ٷ�
//������ ����
lstrcpy(szTemp,BoosterItemInfo[m]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
lstrcpy(szTemp,BoosterItemInfo2[m]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if(i==0 || i==3 || i==6) n=0; // 1�ð�
if(i==1 || i==4 || i==7) n=1; // 3�ð�
if(i==2 || i==5 || i==8) n=2; // 1��
wsprintf(szTemp,AttributeTower[3],BoosterItem_UseTime[n]);
wsprintf(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
break;
}
}
}
if(sInfo.Strength){
lstrcpy(szTemp,sinAbilityName[29]);
wsprintf(szTemp2,"%d\r",sInfo.Strength);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RequireLine[1] = ItemInfoCol;
if(sInfo.Strength >sinChar->Strength){
sRequire.rStrength = 1;
RedLine[1]=ItemInfoCol;
}
}
if(sInfo.Spirit && (sInfo.CODE & sinITEM_MASK2) != sinFO1){
lstrcpy(szTemp,sinAbilityName[30]);
wsprintf(szTemp2,"%d\r",sInfo.Spirit);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RequireLine[2] = ItemInfoCol;
if(sInfo.Spirit > sinChar->Spirit){
sRequire.rSpirit = 1;
RedLine[2]=ItemInfoCol;
}
}
if(sInfo.Talent){
lstrcpy(szTemp,sinAbilityName[31]);
wsprintf(szTemp2,"%d\r",sInfo.Talent);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RequireLine[3] = ItemInfoCol;
if(sInfo.Talent > sinChar->Talent ){
sRequire.rTalent = 1;
RedLine[3]=ItemInfoCol;
}
}
if(sInfo.Dexterity){
lstrcpy(szTemp,sinAbilityName[32]);
wsprintf(szTemp2,"%d\r",sInfo.Dexterity);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RequireLine[4] = ItemInfoCol;
if(sInfo.Dexterity > sinChar->Dexterity){
sRequire.rDexterity =1;
RedLine[4]=ItemInfoCol;
}
}
if(sInfo.Health){
lstrcpy(szTemp,sinAbilityName[33]);
wsprintf(szTemp2,"%d\r",sInfo.Health);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RequireLine[5] = ItemInfoCol;
if(sInfo.Health > sinChar->Health){
sRequire.rHealth = 1;
RedLine[5]=ItemInfoCol;
}
}
ShowItemInfo2(pItem , Flag , Index);
return TRUE;
}
int cITEM::ShowItemInfo2(sITEM *pItem ,int Flag,int Index)
{
int BlockRate = 0;
int sinSpeed = 0;
int sinAbsorb = 0;
int sinLeftSpot = 0;
int sinRightSpot= 0;
int sinMagic_Mastery;
int sinRegen = 0;
char szTemp[64];
char szTemp2[64];
sRequire.rDexterity = 0; //�䱸ġ �÷� �ʱ�ȭ
sRequire.rHealth = 0;
sRequire.rLevel = 0;
sRequire.rSpirit = 0;
sRequire.rStrength = 0;
sRequire.rTalent = 0;
memset(&szTemp,0,sizeof(szTemp));
memset(&szTemp2,0,sizeof(szTemp2));
//////////////////////////Ưȭ ������
if(sInfo.JobCodeMask && (sInfo.CODE & sinITEM_MASK2) != sinFO1){ //ij���� Ưȭ �������̸�
SearchSpecialItemJob(sInfo.JobCodeMask); //��밡�� ij���� Name�� �˾ƿ´� (���� �� �߾ȵ�)
}
if(sInfo.JobItem.Add_Attack_Speed){
lstrcpy(szTemp,sinSpecialName[0]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Add_Attack_Speed);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_Critical_Hit){
lstrcpy(szTemp,sinSpecialName[1]);
wsprintf(szTemp2,"%d%s\r",sInfo.JobItem.Add_Critical_Hit,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_Defence){
lstrcpy(szTemp,sinSpecialName[2]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Add_Defence);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_fAbsorb){
sinAbsorb = (int)(sInfo.JobItem.Add_fAbsorb*10.001f);
sinRightSpot = sinAbsorb %10; //�Ҽ��� ���ڸ���
sinLeftSpot = (sinAbsorb - sinRightSpot)/10;
lstrcpy(szTemp,sinSpecialName[3]);
wsprintf(szTemp2,"%d.%d\r",sinLeftSpot,sinRightSpot);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_fBlock_Rating ){
BlockRate = (int)(sInfo.JobItem.Add_fBlock_Rating);
lstrcpy(szTemp,sinSpecialName[4]);
wsprintf(szTemp2,"%d%s\r",BlockRate,"%");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_fMagic_Mastery){
sinMagic_Mastery = (int)(sInfo.JobItem.Add_fMagic_Mastery);
lstrcpy(szTemp,sinSpecialName[5]);
wsprintf(szTemp2,"%d\r",sinMagic_Mastery);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_fSpeed){
sinSpeed = (int)(sInfo.JobItem.Add_fSpeed *10.001f);
sinRightSpot = sinSpeed %10; //�Ҽ��� ���ڸ���
sinLeftSpot = (sinSpeed - sinRightSpot)/10;
lstrcpy(szTemp,sinSpecialName[6]);
wsprintf(szTemp2,"%d.%d\r",sinLeftSpot,sinRightSpot);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_Resistance[0]){
lstrcpy(szTemp,sinSpecialName[7]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Add_Resistance[0]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_Resistance[1]){
lstrcpy(szTemp,sinSpecialName[8]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Add_Resistance[1]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_Resistance[2]){
lstrcpy(szTemp,sinSpecialName[9]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Add_Resistance[2]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_Resistance[3]){
lstrcpy(szTemp,sinSpecialName[10]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Add_Resistance[3]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_Resistance[4]){
lstrcpy(szTemp,sinSpecialName[11]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Add_Resistance[4]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_Resistance[5]){
lstrcpy(szTemp,sinSpecialName[12]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Add_Resistance[5]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_Resistance[6]){
lstrcpy(szTemp,sinSpecialName[13]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Add_Resistance[6]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_Resistance[7]){
lstrcpy(szTemp,sinSpecialName[14]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Add_Resistance[7]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Lev_Damage[1]){
lstrcpy(szTemp,sinSpecialName[15]);
wsprintf(szTemp2,"LV/%d\r",sInfo.JobItem.Lev_Damage[1]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Lev_Attack_Rating){
lstrcpy(szTemp,sinSpecialName[16]);
wsprintf(szTemp2,"LV/%d\r",sInfo.JobItem.Lev_Attack_Rating);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Add_Shooting_Range){
lstrcpy(szTemp,sinSpecialName[17]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Add_Shooting_Range);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Lev_Attack_Resistance[0]){
lstrcpy(szTemp,sinSpecialName[18]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Lev_Attack_Resistance[0]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Lev_Attack_Resistance[1]){
lstrcpy(szTemp,sinSpecialName[19]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Lev_Attack_Resistance[1]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Lev_Attack_Resistance[2]){
lstrcpy(szTemp,sinSpecialName[20]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Lev_Attack_Resistance[2]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Lev_Attack_Resistance[3]){
lstrcpy(szTemp,sinSpecialName[21]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Lev_Attack_Resistance[3]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Lev_Attack_Resistance[4]){
wsprintf(szTemp,sinSpecialName[22]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Lev_Attack_Resistance[4]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Lev_Attack_Resistance[5]){
lstrcpy(szTemp,sinSpecialName[23]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Lev_Attack_Resistance[5]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Lev_Attack_Resistance[6]){
lstrcpy(szTemp,sinSpecialName[24]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Lev_Attack_Resistance[6]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Lev_Attack_Resistance[7]){
lstrcpy(szTemp,sinSpecialName[25]);
wsprintf(szTemp2,"%d\r",sInfo.JobItem.Lev_Attack_Resistance[7]);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Lev_Life){
lstrcpy(szTemp,sinSpecialName[26]);
wsprintf(szTemp2,"LV/%d\r",sInfo.JobItem.Lev_Life);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Lev_Mana){
lstrcpy(szTemp,sinSpecialName[27]);
wsprintf(szTemp2,"LV/%d\r",sInfo.JobItem.Lev_Mana);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
int sinPer_Regen;
if(sInfo.JobItem.Per_Life_Regen && (sInfo.CODE & sinITEM_MASK2) != sinFO1){
sinPer_Regen = (int)(sInfo.JobItem.Per_Life_Regen *10.001f);
sinRightSpot = sinPer_Regen %10; //�Ҽ��� ���ڸ���
sinLeftSpot = (sinPer_Regen - sinRightSpot)/10;
lstrcpy(szTemp,sinSpecialName[28]);
wsprintf(szTemp2,"%d.%d\r",sinLeftSpot , sinRightSpot);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Per_Mana_Regen && (sInfo.CODE & sinITEM_MASK2) != sinFO1){
sinPer_Regen = (int)(sInfo.JobItem.Per_Mana_Regen *10.001f);
sinRightSpot = sinPer_Regen %10; //�Ҽ��� ���ڸ���
sinLeftSpot = (sinPer_Regen - sinRightSpot)/10;
lstrcpy(szTemp,sinSpecialName[29]);
wsprintf(szTemp2,"%d.%d\r",sinLeftSpot , sinRightSpot);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
if(sInfo.JobItem.Per_Stamina_Regen && (sInfo.CODE & sinITEM_MASK2) != sinFO1){
sinPer_Regen = (int)(sInfo.JobItem.Per_Stamina_Regen *10.001f);
sinRightSpot = sinPer_Regen %10; //�Ҽ��� ���ڸ���
sinLeftSpot = (sinPer_Regen - sinRightSpot)/10;
lstrcpy(szTemp,sinSpecialName[30]);
wsprintf(szTemp2,"%d.%d\r",sinLeftSpot , sinRightSpot);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
char szTemp7[64];
memset(szTemp7,0,sizeof(szTemp7));
if(cShop.OpenFlag){ //������ ���������� ������ ǥ���Ѵ�
lstrcpy(szTemp,"\r");
lstrcpy(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
if(sInfo.Price && pItem->CODE != (sinGF1|sin01) && pItem->CODE != (sinGF1|sin02)){ //���������� ������ ǥ�������ʴ´�
if(Flag == 2){ //�κ��丮
sinItemPrice = cInvenTory.GetInvenItemPrice(pItem);
pItem->SellPrice = sinItemPrice.SellPrice; //�ȸ� ������ �����Ѵ�
lstrcpy(szTemp,sinSpecialName[31]);
// wsprintf(szTemp2,"%d\r",pItem->SellPrice);
NumLineComa(pItem->SellPrice, szTemp7);
lstrcpy(szTemp2,szTemp7);
lstrcat(szTemp2,"\r");
}
if(Flag == 1){ //����
lstrcpy(szTemp,sinSpecialName[32]);
//--------------------------------------------------------------------------//
#ifdef HASIEGE_MODE
//<ha>������ �������� ���������� ����ǥ��
NumLineComa(cShop.haShopItemPrice(sInfo.Price), szTemp7);
#else
NumLineComa(sInfo.Price, szTemp7);
#endif
//---------------------------------------------------------------------------//
lstrcpy(szTemp2,szTemp7);
lstrcat(szTemp2,"\r");
//wsprintf(szTemp2,"%d\r",sInfo.Price);
}
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
}
MyShopItemPriceLine = 0;
if(cMyShop.OpenFlag || cCharShop.OpenFlag){
if(Flag == 3){ //�����
lstrcpy(szTemp,"\r");
lstrcpy(szTemp2,"\r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
lstrcpy(szTemp,MyShopItemSell5);
NumLineComa(MyShopItemSellMoney2, szTemp7);
lstrcpy(szTemp2,szTemp7);
lstrcat(szTemp2," \r");
//wsprintf(szTemp2,"%d\r",MyShopItemSellMoney2);
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
MyShopItemPriceLine = ItemInfoCol;
}
}
if(pItem->CODE == (sinGF1|sin01) ){
lstrcat(szInfoBuff,"\r");
lstrcat(szInfoBuff2,"\r"); //��ĭ �dzʶ�
ItemInfoCol++;
wsprintf(szTemp,sinGold,sInfo.Price);
lstrcat(szTemp,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
//������ �������̳� ����������� ǥ���Ѵ�
if(pItem->sItemInfo.SpecialItemFlag[0] == CHECK_COPY_ITEM){
lstrcat(szInfoBuff,"\r");
lstrcat(szInfoBuff2,"\r"); //��ĭ �dzʶ�
ItemInfoCol++;
lstrcpy(szTemp,sinCopyItem5);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RedLine[6] = ItemInfoCol;
}
if(pItem->sItemInfo.SpecialItemFlag[0] == CHECK_GIVE_ITEM ){
lstrcat(szInfoBuff,"\r");
lstrcat(szInfoBuff2,"\r"); //��ĭ �dzʶ�
ItemInfoCol++;
lstrcpy(szTemp,sinGiveItem5);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RedLine[7] = ItemInfoCol;
}
////////��������� ǥ���Ѵ�
if ( cItem.GetItemLimitTime( pItem )==FALSE ) {
//if(pItem->LimitTimeFlag){
lstrcat(szInfoBuff,"\r");
lstrcat(szInfoBuff2,"\r"); //��ĭ �dzʶ�
ItemInfoCol++;
lstrcpy(szTemp,sinItemLimitTimeOverMsg);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RedLine[8] = ItemInfoCol;
}
///////�Ǹ������� �˷��ش�
if(MyShopItemIndex[Index]){
if(Flag == 2){
lstrcat(szInfoBuff,"\r");
lstrcat(szInfoBuff2,"\r"); //��ĭ �dzʶ�
ItemInfoCol++;
wsprintf(szTemp,"%s",NowMyShopSell);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
RedLine[9] = ItemInfoCol;
}
}
if(smConfig.DebugMode && VRKeyBuff[VK_CONTROL] ){ //������ �϶��� �ø����� �����ش�
wsprintf(szTemp,"%d\r",pItem->sItemInfo.ItemHeader.dwChkSum);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
wsprintf(szTemp,"%d\r",pItem->sItemInfo.ItemHeader.Head);
lstrcat(szInfoBuff,szTemp);
lstrcpy(szTemp2,"\r"); //��ĭ �dzʶ�
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
}
GetInfoBoxSize(pItem , ItemInfoCol);
sinLineCount = ItemInfoCol;
return TRUE;
}
//�ڽ��� ũ�⸦ ���Ѵ�
int cITEM::GetInfoBoxSize(sITEM *pItem , int Col)
{
int ty , tx;
ItemBoxSize.x = 10; //���� ���� ������� 256���� �����Ѵ� (��? �����̴ϱ� ��������)
ItemBoxSize.y = Col+1; //���� ����ŭ ����� ��´�
ItemBoxPosi.x = (pItem->x+(pItem->w/2))-((ItemBoxSize.x*16)/2);
ItemBoxPosi.y = pItem->y - (ItemBoxSize.y*16); //������ �����ڽ��� ���� ��ġ
ty = ItemBoxPosi.y + (ItemBoxSize.y*16);
tx = ItemBoxPosi.x + (ItemBoxSize.x*16);
/////////////ȭ������� ������ �ʰ� ��ġ ����
if(ItemBoxPosi.y < 0)
ItemBoxPosi.y = 0;
if(ItemBoxPosi.x < 0)
ItemBoxPosi.x = 0;
if(ty > 600)
ItemBoxPosi.y -= (ty - 600);
if(tx > 800)
ItemBoxPosi.x -= (tx - 800);
return TRUE;
}
int cITEM::DrawItemText() //������ ���� �ؽ�Ʈ
{
if(!sinShowItemInfoFlag)return FALSE;
if(sinShowItemInfoFlag == 1)dsDrawOffsetArray = dsARRAY_TOP;
else dsDrawOffsetArray = dsARRAY_BOTTOM;
HDC hdc;
//char *Test ="�ڻ�������������������";
int i , Count=0;
int len,len2;
int TempLen = 0;
int TempLen2 = 0;
int Templen = 0; //�ӽ÷� �ٰ����� ���ؼ� �־��ش�
int TemplenNum = 0 ;
int ImsiLen = 0;
int Textlen = 0;
int Textlen2 = 0;
int SetTextXposi=0;
int SetTextXposi2=0;
int CutLen = 0;
int CutLen2 = 0;
int j;
char *pItemInfo[40];
char *pItemInfo2[40];
/////////////��ġ�� �÷�
int BlodCheckFlag =0;
renderDevice.lpDDSBack->GetDC(&hdc);
SelectObject( hdc, sinFont);
SetBkMode( hdc, TRANSPARENT );
len = lstrlen(szInfoBuff);
len2 = lstrlen(szInfoBuff2);
/*
SetTextColor( hdc, RGB(255,180,100) );
dsTextLineOut(hdc,SetTextXposi,ItemBoxPosi.y, "testtest" , 8 );
SelectObject( hdc, sinFont);
SetBkMode( hdc, TRANSPARENT );
SetTextColor( hdc, RGB(255,180,100) );
dsTextLineOut(hdc,SetTextXposi,ItemBoxPosi.y+32, "testtest" , 8 );
lpDDSBack->ReleaseDC( hdc );
return TRUE;
*/
char szInfoBuffBack[5000];
char szInfoBuff2Back[5000];
char szAgingNum[32];
int TempLen3 = 0; //���λ������� �߲ٳ��°��� �����
lstrcpy( szInfoBuffBack , szInfoBuff );
lstrcpy( szInfoBuff2Back , szInfoBuff2 );
for( i = 0 ; i < len ; i++){
for( j=0 ; j < len2 ; j++){
if(szInfoBuffBack[i] == '\r'){
if(szInfoBuff2Back[j] == '\r'){
pItemInfo[Count] = &szInfoBuffBack[TempLen];
pItemInfo2[Count] = &szInfoBuff2Back[TempLen2];
szInfoBuffBack[i] = 0;
szInfoBuff2Back[j] = 0;
TempLen = i+1;
TempLen2 = j+1;
Textlen = lstrlen(pItemInfo[Count]);
Textlen2 = lstrlen(pItemInfo2[Count]);
SetTextXposi = (ItemBoxPosi.x + (158/2)) - (Textlen*6);
SetTextXposi2 = (ItemBoxPosi.x + (158/2));
//��ġ����
SetTextXposi += 20;
SetTextXposi2 += 17;
//Ưȭ //�̸�
if(*pItemInfo2[Count] == ' ' || Textlen2 < 1){
SetTextXposi = (ItemBoxPosi.x + (158/2)) - (Textlen*3);
}
#ifdef _LANGUAGE_VEITNAM
char test[1024];
ZeroMemory(test,sizeof(char)*1024);
strcat(test,pItemInfo[Count]);
strcat(test,pItemInfo2[Count]);
SIZE sizecheck;
GetTextExtentPoint32(hdc,test,lstrlen(test),&sizecheck);
SetTextXposi = ItemBoxPosi.x+(((ItemBoxSize.x*16)-sizecheck.cx)/2);
#endif
#ifdef _LANGUAGE_THAI
char test[1024];
ZeroMemory(test,sizeof(char)*1024);
strcat(test,pItemInfo[Count]);
strcat(test,pItemInfo2[Count]);
SIZE sizecheck;
GetTextExtentPoint32(hdc,test,lstrlen(test),&sizecheck);
SetTextXposi = ItemBoxPosi.x+(((ItemBoxSize.x*16)-sizecheck.cx)/2);
#endif
#ifdef _LANGUAGE_BRAZIL
char test[1024];
ZeroMemory(test,sizeof(char)*1024);
strcat(test,pItemInfo[Count]);
strcat(test,pItemInfo2[Count]);
SIZE sizecheck;
GetTextExtentPoint32(hdc,test,lstrlen(test),&sizecheck);
SetTextXposi = ItemBoxPosi.x+(((ItemBoxSize.x*16)-sizecheck.cx)/2);
#endif
//�Ƹ���Ƽ��
#ifdef _LANGUAGE_ARGENTINA
char test[1024];
ZeroMemory(test,sizeof(char)*1024);
strcat(test,pItemInfo[Count]);
strcat(test,pItemInfo2[Count]);
SIZE sizecheck;
GetTextExtentPoint32(hdc,test,lstrlen(test),&sizecheck);
SetTextXposi = ItemBoxPosi.x+(((ItemBoxSize.x*16)-sizecheck.cx)/2);
#endif
//�߱�
#ifdef _LANGUAGE_CHINESE
char test[1024];
ZeroMemory(test,sizeof(char)*1024);
strcat(test,pItemInfo[Count]);
strcat(test,pItemInfo2[Count]);
SIZE sizecheck;
GetTextExtentPoint32(hdc,test,lstrlen(test),&sizecheck);
SetTextXposi = ItemBoxPosi.x+(((ItemBoxSize.x*16)-sizecheck.cx)/2);
#endif
#ifdef _LANGUAGE_ENGLISH
char test[1024];
ZeroMemory(test,sizeof(char)*1024);
strcat(test,pItemInfo[Count]);
strcat(test,pItemInfo2[Count]);
SIZE sizecheck;
GetTextExtentPoint32(hdc,test,lstrlen(test),&sizecheck);
SetTextXposi = ItemBoxPosi.x+(((ItemBoxSize.x*16)-sizecheck.cx)/2);
#endif
SetTextColor( hdc, RGB(255,255,255) );
if(Count+1 == 1){
if(UniFlag)
SetTextColor( hdc, RGB(128,255,128) );
else{
SetTextColor( hdc, RGB(222,231,255) );
if(sinItemKindFlag){
switch(sinItemKindFlag){
case ITEM_KIND_CRAFT:
//SetTextColor( hdc, RGB(132,240,254) );
SetTextColor( hdc, RGB(150,255,255) );
break;
case ITEM_KIND_AGING:
SetTextColor( hdc, RGB(255,250,0) ); //����¡ ������
break;
case ITEM_KIND_QUEST_WEAPON:
SetTextColor( hdc, RGB(132,50,254) ); //����Ʈ������
break;
case 100: //��� ������
SetTextColor( hdc, RGB(255,100,29) ); //����Ʈ������
break;
}
}
}
SelectObject( hdc, sinBoldFont);
SetBkMode( hdc, TRANSPARENT );
dsTextLineOut(hdc,SetTextXposi-3,ItemBoxPosi.y+27+((Count-1)*14), pItemInfo[Count] , Textlen );
BlodCheckFlag = 1;
}
if(AgingGageFlag){
SetTextColor( hdc, RGB(0,0,0) ); //����¡ ������
SelectObject( hdc, sinFont);
SetBkMode( hdc, TRANSPARENT );
wsprintf(szAgingNum,"+%d",AgingLevel4);
if(AgingLevel4 <10)
dsTextLineOut(hdc,ItemBoxPosi.x+72,ItemBoxPosi.y+34, szAgingNum , lstrlen(szAgingNum));
else
dsTextLineOut(hdc,ItemBoxPosi.x+69,ItemBoxPosi.y+34, szAgingNum , lstrlen(szAgingNum));
}
SetTextColor( hdc, RGB(255,255,255) ); //�⺻��
for(j = 0 ; j < 10 ; j++){
if(Count+1 == MixItemLine[j])
SetTextColor( hdc, RGB(110,165,250) ); //�ͽ��ľ�����
if(AgingGageFlag){
if(Count+1 == AgingItemLine[j])
SetTextColor( hdc, RGB(119,200,254) );
//SetTextColor( hdc, RGB(110,165,250) ); //�ͽ��ľ�����
//SetTextColor( hdc, RGB(255,220,100) ); //����¡ ������1
}
}
if(SpecialItemLine){ //Ưȭ�������϶�
if(SpecialItemLine <= Count+2){
SetTextColor( hdc, RGB(164,199,41) ); //Ưȭ ������
}
if(SpecialItemLine == Count+2 || (SpecialItemLine +(CountSpecialName-1)) == Count+2)
SetTextColor( hdc, RGB(255,220,0) ); //Ưȭ ����
}
for( j = 0 ; j < 10 ; j ++){
if(Count+1 == RequireLine[j])
SetTextColor( hdc, RGB(255,180,100) );
if(Count+1 == RedLine[j])
SetTextColor( hdc, RGB(255,0,0) );
}
if(cShop.OpenFlag){ //������ ���������� ������ ǥ���Ѵ�
if(Count == sinLineCount-1)
SetTextColor( hdc, RGB(247,243,193) ); //����
}
SelectObject( hdc, sinFont);
SetBkMode( hdc, TRANSPARENT );
if( Count+1 == QuestItemLine){
SelectObject( hdc, sinBoldFont);
SetBkMode( hdc, TRANSPARENT );
SetTextColor( hdc, RGB(125,180,175) ); //����Ʈ������
}//
if( Count+1 == MyShopItemPriceLine){
SelectObject( hdc, sinFont);
SetBkMode( hdc, TRANSPARENT );
SetTextColor( hdc, RGB(65,177,255) ); //������ �Ǹ�
}
#ifdef _LANGUAGE_VEITNAM
if(!BlodCheckFlag){
dsTextLineOut(hdc,SetTextXposi-TempLen3,ItemBoxPosi.y+28+((Count-1)*14), test , Textlen+Textlen2 );
}
#else
#ifdef _LANGUAGE_THAI
if(!BlodCheckFlag){
dsTextLineOut(hdc,SetTextXposi-TempLen3,ItemBoxPosi.y+28+((Count-1)*14), test , Textlen+Textlen2 );
}
#else
#ifdef _LANGUAGE_BRAZIL
if(!BlodCheckFlag){
dsTextLineOut(hdc,SetTextXposi-TempLen3,ItemBoxPosi.y+28+((Count-1)*14), test , Textlen+Textlen2 );
}
#else
//�Ƹ���Ƽ��
#ifdef _LANGUAGE_ARGENTINA
if(!BlodCheckFlag){
dsTextLineOut(hdc,SetTextXposi-TempLen3,ItemBoxPosi.y+28+((Count-1)*14), test , Textlen+Textlen2 );
}
#else
//�߱�
#ifdef _LANGUAGE_CHINESE
if(!BlodCheckFlag){
dsTextLineOut(hdc,SetTextXposi-TempLen3,ItemBoxPosi.y+28+((Count-1)*14), test , Textlen+Textlen2 );
}
#else
#ifdef _LANGUAGE_ENGLISH
if(!BlodCheckFlag){
dsTextLineOut(hdc,SetTextXposi-TempLen3,ItemBoxPosi.y+28+((Count-1)*14), test , Textlen+Textlen2 );
}
#else
if(!BlodCheckFlag)
{
//if(Count==3) SetTextXposi2=50;
dsTextLineOut(hdc,SetTextXposi-TempLen3,ItemBoxPosi.y+28+((Count-1)*14), pItemInfo[Count] , Textlen );
dsTextLineOut(hdc,SetTextXposi2-TempLen3,ItemBoxPosi.y+28+((Count-1)*14), pItemInfo2[Count] , Textlen2 );
dsTextLineOut(hdc,SetTextXposi2+1-TempLen3,ItemBoxPosi.y+28+((Count-1)*14), pItemInfo2[Count] , Textlen2 );
}
#endif
#endif
#endif
#endif
#endif
#endif
BlodCheckFlag = 0;
Count++;
break;
}
}
}
}
// len = lstrlen(Test);
// dsTextLineOut(hdc,ItemBoxPosi.x,ItemBoxPosi.y,Test,len);
renderDevice.lpDDSBack->ReleaseDC(hdc);
return TRUE;
}
//Ưȭ ������ ã�´�
int cITEM::SearchSpecialItemJob(DWORD SpecialJob_CODE) //Ưȭ ij���� ���� ������
{
// WS201 WS202 WS203
int cnt;
char szTemp[64];
char szTemp2[64];
CountSpecialName = 0;
cnt = 0;
while(1) {
if ( JobDataBase[cnt].JobBitCode ==0 )break;
if ( JobDataBase[cnt].JobBitCode & SpecialJob_CODE ) {
wsprintf(szTemp,SpecialName3,JobDataBase[cnt].szName2);
lstrcpy(szTemp2," \r");
lstrcat(szInfoBuff,szTemp);
lstrcat(szInfoBuff2,szTemp2);
ItemInfoCol++;
SpecialItemLine = ItemInfoCol+1;
CountSpecialName++;
SpecialItemLine -= (CountSpecialName-1);
}
cnt++;
}
return FALSE;
}
int ItemTableCheckDelayTime = 0;
/////////������ ���̺� ������ ���´�
int cITEM::CheckItemTable()
{
ItemTableCheckDelayTime++;
if(ItemTableCheckDelayTime < 70*10)return FALSE;
ItemTableCheckDelayTime = 0;
DWORD CheckSumItemDataADD = 0;
for(int j=0 ; j <INVENTORY_MAX_POS ; j++)
{
if(sInven[j].Position)
{
CheckSumItemDataADD += sInven[j].Position * j;
}
}
for(int i=0 ; i < MAX_ITEM ; i++)
{
if(sItem[i].CODE)
{
CheckSumItemDataADD += sItem[i].CODE * i;
CheckSumItemDataADD += sItem[i].h * i;
CheckSumItemDataADD += sItem[i].w * i;
CheckSumItemDataADD += sItem[i].Class * i;
CheckSumItemDataADD += sItem[i].ItemPosition * i;
}
}
const DWORD CheckSumItemData = 3977515816;
//������ �߰��� üũ�� ������ //kyle
//DRZ_EDIT
/*
if( CheckSumItemData != CheckSumItemDataADD){
SendSetHackUser(101); //��ŷ�� �Ϸ����ߴ� ���� ������ ��� TRUE ���� ����
// SendSetHackUser2(4100,88); //��ŷ�� ������ �Ű��Ѵ�
// CheckSumItemData = CheckSumItemDataADD; //��ġ�� ���� ~~~
}
*/
return TRUE;
}
//////// ����Ⱓ�� �ִ� �������� �Ⱓ�� ���ؿ´�
int cITEM::GetItemLimitTime(sITEM *pItem)
{
/* ������� ���ش�
/////////���� �ð��� ���Ѵ� ��а�
DWORD Time=0;
Time = 60*60*24*7;
if((pItem->sItemInfo.CODE & sinITEM_MASK2)==sinSP1 || (pItem->sItemInfo.CODE & sinITEM_MASK2)==sinCH1)
{
if( (pItem->sItemInfo.CODE & sinITEM_MASK3)==sin15 ) // ����� - ���� ��ƿ��� �̺�Ʈ
return TRUE;
if(sinItemTime > (pItem->sItemInfo.dwCreateTime+Time) )
{
//pItem->LimitTimeFlag = 1;
return FALSE;
}
}
*/
return TRUE;
}
/*
//�����̾� ����ȭ ������
void cITEM::SetItemInfo(char *Buff)
{
int len = lstrlen(Buff);
int cnt=0,j=0;
for(int i=0;i<len;i++,j++){
if(Buff[i]!='/')
//PremiumItemInfo.PremiumItemInfo[cnt][j] = Buff[i];
else
cnt++,j=0;
}
}
*/
|
#pragma once
#include "Command.hpp"
class AbstractCommandHandler
{
public:
virtual void HandleCommand(const Command& cmd) const = 0;
virtual ~AbstractCommandHandler() {}
};
|
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll m,n,i,j,k;
ll l=1, h=1000000;
while( l !=h )
{
ll mid=(l+h+1)/2;
printf("%lld\n", mid);
fflush(stdout);
char c[3];
scanf("%s", c);
if( strcmp(c, "<" )==0 )
{
h=mid-1;
}
else l=mid;
}
printf("! %lld\n", l);
fflush(stdout);
}
|
#include<iostream>
#include<vector>
using namespace std;
const int NMAX=10100;
int n,q,c,x,y;
int r[NMAX]={0},p[NMAX]={0};
void make(int x){
for(int i=0;i<x;++i){
p[i]=i;
}
}
void link(int x,int y){
if(r[x]>r[y]){
p[y]=x;
}
else{
p[x]=y;
if(r[x]==r[y]){
r[y]++;
}
}
}
int find(int x){
if(x!=p[x]){
return p[x]=find(p[x]);
}
return x;
}
void unite(int x,int y){
link(find(x),find(y));
}
bool same(int x,int y){
return find(x)==find(y);
}
int main(){
cin>>n>>q;
make(n);
for(int i=0;i<q;++i){
cin>>c>>x>>y;
if(c==0){
unite(x,y);
}
else{
if(same(x,y)){
cout<<1<<endl;
}
else{
cout<<0<<endl;
}
}
}
return 0;
}
|
/*
* JobBuffer.h
*
* Created on: 2016年9月23日
* Author: kean
*/
#ifndef JOBBUFFER_H_
#define JOBBUFFER_H_
#include "RtmpInfo.h"
#include <pthread.h>
#include <iostream>
#include <list>
using namespace std;
class JobBuffer {
private:
pthread_mutex_t mutex;
list<RtmpInfo *> area;
public:
int index;
public:
bool tryLock();
bool release();
void addToBuffer(RtmpInfo *data);
void getFromBuffer(list<RtmpInfo *> & lists);
public:
JobBuffer(int index);
virtual ~JobBuffer();
};
#endif /* JOBBUFFER_H_ */
|
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the University of Oxford nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
*
*
*
* Chaste tutorial - this page gets automatically changed to a wiki page
* DO NOT remove the comments below, and if the code has to be changed in
* order to run, please check the comments are still accurate
*
*
*
*
*
*/
#ifndef TESTSOLVINGNONLINEARPDESTUTORIAL_HPP_
#define TESTSOLVINGNONLINEARPDESTUTORIAL_HPP_
/* HOW_TO_TAG PDE
* Define and solve nonlinear elliptic PDEs
*/
/*
* = An example showing how to solve a nonlinear elliptic PDE. Also includes function-based boundary conditions. =
*
* In this tutorial we show how Chaste can be used to solve nonlinear elliptic PDEs.
* We will solve the PDE div.(u grad u) + 1 = 0, on a square domain, with boundary
* conditions u=0 on y=0; and Neumann boundary conditions: (u grad u).n = 0 on x=0 and x=1;
* and (u grad u).n = y on y=1.
*
* For nonlinear PDEs, the finite element equations are of the form F(U)=0, where
* U=(U,,1,, , ... , U,,N,,) is a vector of the unknowns at each node, and F is some
* non-linear vector valued function. To solve this, a nonlinear solver is required.
* Chaste can solve this with Newton's method, or (default) use PETSc's nonlinear solvers.
* Solvers of such nonlinear problems usually require the Jacobian of the problem, i.e. the
* matrix A = dF/dU, or at least an approximation of the Jacobian.
*
* The following header files need to be included, as in the linear PDEs tutorial.
*/
#include <cxxtest/TestSuite.h>
#include "UblasIncludes.hpp"
#include "TrianglesMeshReader.hpp"
#include "TetrahedralMesh.hpp"
#include "BoundaryConditionsContainer.hpp"
#include "ConstBoundaryCondition.hpp"
#include "OutputFileHandler.hpp"
#include "PetscSetupAndFinalize.hpp"
/* This is the solver for nonlinear elliptic PDEs. */
#include "SimpleNonlinearEllipticSolver.hpp"
/* In this test we also show how to define Neumman boundary conditions which
* depend on spatial location, for which the following class is needed. */
#include "FunctionalBoundaryCondition.hpp"
/* We will choose to use the Chaste Newton solver rather than PETSc's nonlinear
* solver. */
#include "SimpleNewtonNonlinearSolver.hpp"
/* As in the linear PDEs tutorial, we have to define the PDE class we want to
* solve (assuming one has not already been created). Nonlinear elliptic PDEs
* should inherit from {{{AbstractNonlinearEllipticPde}}}, which has five pure
* methods which have to be implemented in this concrete class. Here, we define
* the PDE div.(u grad u) + 1 = 0.
*/
class MyNonlinearPde : public AbstractNonlinearEllipticPde<2>
{
public:
/* The first is the part of the source term that is independent of u. */
double ComputeLinearSourceTerm(const ChastePoint<2>& rX)
{
return 1.0;
}
/* The second is the part of the source term that is dependent on u. */
double ComputeNonlinearSourceTerm(const ChastePoint<2>& rX, double u)
{
return 0.0;
}
/* The third is the diffusion tensor, which unlike in the linear case can be
* dependent on u. The diffusion tensor should be symmetric and positive definite. */
c_matrix<double,2,2> ComputeDiffusionTerm(const ChastePoint<2>& rX, double u)
{
return identity_matrix<double>(2)*u;
}
/* We also need to provide the derivatives with respect to u of the last two methods,
* so that the Jacobian matrix can be assembled. The derivative of the nonlinear source
* term is
*/
double ComputeNonlinearSourceTermPrime(const ChastePoint<2>& , double )
{
return 0.0;
}
/* And the derivative of the diffusion tensor is just the identity matrix. */
c_matrix<double,2,2> ComputeDiffusionTermPrime(const ChastePoint<2>& rX, double u)
{
return identity_matrix<double>(2);
}
};
/* We also need to define a (global) function that will become the Neumman boundary
* conditions, via the {{{FunctionalBoundaryCondition}}} class (see below). This
* function is f(x,y) = y.
*/
double MyNeummanFunction(const ChastePoint<2>& rX)
{
return rX[1];
}
/* Next, we define the test suite, as before. */
class TestSolvingNonlinearPdesTutorial : public CxxTest::TestSuite
{
public:
/* Define a particular test. Note the {{{}}} at the end of the
* declaration. This causes {{{Exception}}} messages to be printed out if an
* {{{Exception}}} is thrown, rather than just getting the message "terminate
* called after throwing an instance of 'Exception' " */
void TestSolvingNonlinearEllipticPde()
{
/* As usual, first create a mesh. */
TrianglesMeshReader<2,2> mesh_reader("mesh/test/data/square_128_elements");
TetrahedralMesh<2,2> mesh;
mesh.ConstructFromMeshReader(mesh_reader);
/* Next, instantiate the PDE to be solved. */
MyNonlinearPde pde;
/*
* Then we have to define the boundary conditions. First, the Dirichlet boundary
* condition, u=0 on x=0, using the boundary node iterator.
*/
BoundaryConditionsContainer<2,2,1> bcc;
ConstBoundaryCondition<2>* p_zero_bc = new ConstBoundaryCondition<2>(0.0);
for (TetrahedralMesh<2,2>::BoundaryNodeIterator node_iter = mesh.GetBoundaryNodeIteratorBegin();
node_iter != mesh.GetBoundaryNodeIteratorEnd();
node_iter++)
{
if (fabs((*node_iter)->GetPoint()[1]) < 1e-12)
{
bcc.AddDirichletBoundaryCondition(*node_iter, p_zero_bc);
}
}
/* And then the Neumman conditions. Neumann boundary condition are defined on
* surface elements, and for this problem, the Neumman boundary value depends
* on the position in space, so we make use of the {{{FunctionalBoundaryCondition}}}
* object, which contains a pointer to a function, and just returns the value
* of that function for the required point when the {{{GetValue}}} method is called.
*/
FunctionalBoundaryCondition<2>* p_functional_bc = new FunctionalBoundaryCondition<2>(&MyNeummanFunction);
/* Loop over surface elements. */
for (TetrahedralMesh<2,2>::BoundaryElementIterator elt_iter = mesh.GetBoundaryElementIteratorBegin();
elt_iter != mesh.GetBoundaryElementIteratorEnd();
elt_iter++)
{
/* Get the y value of any node (here, the zero-th). */
double y = (*elt_iter)->GetNodeLocation(0,1);
/* If y=1... */
if (fabs(y-1.0) < 1e-12)
{
/* ... then associate the functional boundary condition, (Dgradu).n = y,
* with the surface element... */
bcc.AddNeumannBoundaryCondition(*elt_iter, p_functional_bc);
}
else
{
/* ...else associate the zero boundary condition (i.e. zero flux) with this
* element. */
bcc.AddNeumannBoundaryCondition(*elt_iter, p_zero_bc);
}
}
/* Note that in the above loop, the zero Neumman boundary condition was applied
* to all surface elements for which y!=1, which included the Dirichlet surface
* y=0. This is OK, as Dirichlet boundary conditions are applied to the finite
* element matrix after Neumman boundary conditions, where the appropriate rows
* in the matrix are overwritten.
*
* This is the solver for solving nonlinear problems, which, as usual,
* takes in the mesh, the PDE, and the boundary conditions. */
SimpleNonlinearEllipticSolver<2,2> solver(&mesh, &pde, &bcc);
/* The solver also needs to be given an initial guess, which will be
* a PETSc vector. We can make use of a helper method to create it.
*/
Vec initial_guess = PetscTools::CreateAndSetVec(mesh.GetNumNodes(), 0.25);
/* '''Optional:''' To use Chaste's Newton solver to solve nonlinear vector equations that are
* assembled, rather than the default PETSc nonlinear solvers, we can
* do the following: */
SimpleNewtonNonlinearSolver newton_solver;
solver.SetNonlinearSolver(&newton_solver);
/* '''Optional:''' We can also manually set tolerances, and whether to print statistics, with
* this nonlinear vector equation solver */
newton_solver.SetTolerance(1e-10);
newton_solver.SetWriteStats();
/* Now call {{{Solve}}}, passing in the initial guess */
Vec answer = solver.Solve(initial_guess);
/* Note that we could have got the solver to not use an analytical Jacobian
* and use a numerically-calculated Jacobian instead, by passing in false as a second
* parameter:
*/
//Vec answer = solver.Solve(initial_guess, false);
/* Once solved, we can check the obtained solution against the analytical
* solution. */
ReplicatableVector answer_repl(answer);
for (unsigned i=0; i<answer_repl.GetSize(); i++)
{
double y = mesh.GetNode(i)->GetPoint()[1];
double exact_u = sqrt(y*(4-y));
TS_ASSERT_DELTA(answer_repl[i], exact_u, 0.15);
}
/* Finally, we have to remember to destroy the PETSc {{{Vec}}}s. */
PetscTools::Destroy(initial_guess);
PetscTools::Destroy(answer);
}
};
#endif /*TESTSOLVINGNONLINEARPDESTUTORIAL_HPP_*/
|
/*
*using switch
* - Days of week
*/
#include "iostream"
using namespace std;
int main()
{
int num;
cout<<"\t\t\tDAYS OF WEEK\n";
cout<<"Enter number :- ";
ab:
cin>>num;
switch (num)
{
case 1: cout<<"\n Monday \n";
break;
case 2: cout<<"\n Tuesday \n";
break;
case 3: cout<<"\n Wednesday \n";
break;
case 4: cout<<"\n Thursday \n";
break;
case 5: cout<<"\n Friday \n";
break;
case 6: cout<<"\n Saturday \n";
break;
case 7: cout<<"\n Sunday \n";
break;
default:cout<<"WORNG CHOICE\nEnter choice again:- ";
goto ab;
break;
}
system("pause");
return 0;
}
|
/*----------------------------------------------------------------
Copyright (c) 2017 Author: Jagadeesh Vasudevamurthy
file: e8p.h
-----------------------------------------------------------------*/
/*----------------------------------------------------------------
This file has e8p class declaration
-----------------------------------------------------------------*/
/*----------------------------------------------------------------
All includes here
-----------------------------------------------------------------*/
#ifndef e8p_H
#define e8p_H
#include "../util/util.h"
#include <unordered_map>
#include <queue>
#include <string>
#include <unordered_set>
/*----------------------------------------------------------------
Node definition
1. Node is the current configuration
2. Private member array
-----------------------------------------------------------------*/
class node {
public:
static const int N = 3;
node(const int s[N][N], bool);
//~node();
node(const node&);
node& operator=(const node&);
node configure(char);
bool isValid() {
return _valid == true;
}
void print_node() {
for (int i = 0; i < N; ++i) {
for (int j = 0; j < N; ++j) {
int v = _current[i][j];
if (v) {
cout << v << ' ';
}
else {
cout << ' ' << ' ';
}
}
cout << endl;
}
}
friend bool operator==(const node&, const node&);
size_t getHash() const {
return _hash;
}
private:
int _current[N][N];
bool _valid;
size_t _hash;
size_t _calculateHash();
void _copy(const node&);
string _substring;
friend class board;
friend class e8p;
};
struct NodeHasher {
size_t operator()(const node& obj) const {
return obj.getHash();
}
};
struct NodeComparator {
bool operator()(const node& obj1, const node& obj2) const {
return obj1 == obj2;
}
};
/*----------------------------------------------------------------
Declaration of board
1. Board stores the map of nodes
2. Board uses a queue to keep track of BFS traversal
-----------------------------------------------------------------*/
class board{
public:
static const int N = 3;
board(const int[N][N], const int[N][N]);
//~board();
void play();
private:
unordered_set<node, NodeHasher, NodeComparator> _map;
queue<node> _q;
node _start;
node _final;
string _solution;
int _moves;
char _dirs[4] = { 'U', 'L', 'D', 'R' };
friend class e8p;
};
/*----------------------------------------------------------------
Declaration of e8p class
-----------------------------------------------------------------*/
class e8p{
public:
static const int N = 3 ;
e8p(const int s[N][N], const int f[N][N]);
~e8p();
e8p(const e8p& from) = delete;
e8p& operator=(const e8p& from) = delete;
int get_num_moves() const {
return _moves;
}
string get_solution() const {
return _solution;
}
private:
int _moves;
string _solution;
board _game;
//int _start[N][N];
//int _final[N][N];
};
#endif
//EOF
|
#include <glew.h>
#include <glut.h>
#include <iostream>
#include <vector>
#include "textfile.h" // header file for code to read a textfile
int winXRes = 600;
int winYRes = 600;
GLuint vbo = 0;//used to store the vertex buffer object
GLuint vao = 0;//used to store the vertex array object
int numOfVertex = 108;
float drawCubeVert[108];
char *vs = nullptr;
char *fs = nullptr;
GLuint sID;
char ch = '1';
FILE *filePointer;
int read = 0;
GLfloat x, y, z;
struct Vertex
{
float x;
float y;
float z;
};
static std::vector<Vertex*> vertList;
static std::vector<Vertex*>Faces;
/*
*Check that the shader has compiled, this is because we cannot see in the same way as normal code, if
* there is a compile error in the shader code.
*/
void shaderCompilerCheck(GLuint ID)
{
GLint comp;
glGetShaderiv(ID, GL_COMPILE_STATUS, &comp);//return the compile status from the shader
if(comp == GL_FALSE)//if it fails, print an error message
{
printf("Shader Compilation failed");
GLchar messages[256];
glGetShaderInfoLog(ID, sizeof(messages), 0, &messages[0]);
printf("message %s \n", messages);
}
}
/*
* Checks that the shader has been linked into the main application correctly
* Outputs errors in the shader
*/
void shaderLinkCheck(GLuint ID)
{
GLint linkStatus, validateStatus;
glGetProgramiv(ID, GL_LINK_STATUS, &linkStatus);//return the linker status from the shader
if (linkStatus == GL_FALSE)
{
printf("Shader linking failed\n");
GLchar messages[256];
glGetProgramInfoLog(ID, sizeof(messages), 0, &messages[0]);
printf("message %s \n", messages);
}
glValidateProgram(ID);
glGetProgramiv(ID, GL_VALIDATE_STATUS, &validateStatus);//return the result of the validation process
if (validateStatus == GL_FALSE)//if the application failed to validate, print the error
{
printf("Shader validation failed\n");
GLchar messages[256];
glGetProgramInfoLog(ID, sizeof(messages), 0, &messages[0]);
printf("message %s \n", messages);
}
}
/*
* function to create the vert and frag shaders
*/
void shaders()
{
sID = glCreateProgram();
GLuint vID = glCreateShader(GL_VERTEX_SHADER);
GLuint fID = glCreateShader(GL_FRAGMENT_SHADER);
vs = textFileRead("VertexShader.vert");
fs = textFileRead("FragmentShader.frag");
glShaderSource(vID, 1, &vs, NULL);//loads the contents of the vert shader
glShaderSource(fID, 1, &fs, NULL);//loads the contents of the fragment shader
glCompileShader(vID);//compile the vert shader
glCompileShader(fID);//compile the frag shader
shaderCompilerCheck(vID);//check for compile errors in the vert shader
shaderCompilerCheck(fID);//check for compile errors in the frag shader
glAttachShader(sID, vID);//attached the shader to the main program
glAttachShader(sID, fID);//attached the fragment shader to the main program
glBindAttribLocation(sID, 0, "VertexPosition");//bind the index 0 to the shader input variable "VertexPosition"
glBindAttribLocation(sID, 1, "VertexColor");//bind index 1 to the shader input variable VertexColor;
glLinkProgram(sID);//send the vertex shader program to the GPU vertex processor, and the fragment to the GPU fragment processor
shaderLinkCheck(sID);//check the linker for errors
GLuint Buffers[2];
glGenBuffers(1, Buffers);//create 2 buffer objects
vbo = Buffers[0];//set vbo to the first buffer object
//vertex array
glBindBuffer(GL_ARRAY_BUFFER, vbo);//make the buffer object a vertex array
glBufferData(GL_ARRAY_BUFFER, numOfVertex * sizeof(float), drawCubeVert, GL_STATIC_DRAW);//set the size of the buffer and insert the data
glGenVertexArrays(1, &vao); //generate a name for the vert array
glBindVertexArray(vao);//bind the vert array object
glEnableVertexAttribArray(0);//enable the vert array
glEnableVertexAttribArray(1);//enable the color array
//map index 0 to the position buffer
glBindBuffer(GL_ARRAY_BUFFER, vao);
glVertexAttribPointer(0, 3, GL_FLOAT,GL_FALSE, 0, NULL);//apply some properties to the verticies
}
void ReadOBJ()
{
filePointer = fopen("cube.obj", "r"); //Open the file for reading
if (!filePointer)
{
std::cout << "Can't open file: " << std::endl;
exit(1);
}
int i = 0;
int j = 0;
while (!(feof(filePointer))) // while not at the end of the file
{
read = fscanf(filePointer, "%c %f %f %f", &ch, &x, &y, &z);
if (read == 4 && ch == 'v')//if the char is v, populate the vertex array
{
Vertex *vert = new Vertex;
vertList.push_back(vert);
vertList[i]->x = x;
vertList[i]->y = y;
vertList[i]->z = z;
i++;
}
if (read == 4 && ch == 'f')//if it is f, populate the face array
{
Vertex *face = new Vertex;
Faces.push_back(face);
Faces[j]->x = x;
Faces[j]->y = y;
Faces[j]->z = z;
j++;
}
}
std::cout << "File read successfully." << std::endl;
}
/*split the vertex vector into an array*/
void genFaces()
{
int faceIndex = 0;
for (auto &face : Faces)//for every face in the array
{
drawCubeVert[faceIndex] = vertList[face->x - 1]->x; //////////////////////////////////////////
faceIndex++; //Find the x/y/z for each face //
drawCubeVert[faceIndex] = vertList[face->x - 1]->y; //in the list and assign it to the array//
faceIndex++; //////////////////////////////////////////
drawCubeVert[faceIndex] = vertList[face->x - 1]->z;
faceIndex++;
drawCubeVert[faceIndex] = vertList[face->y - 1]->x;
faceIndex++;
drawCubeVert[faceIndex] = vertList[face->y - 1]->y;
faceIndex++;
drawCubeVert[faceIndex] = vertList[face->y - 1]->z;
faceIndex++;
drawCubeVert[faceIndex] = vertList[face->z - 1]->x;
faceIndex++;
drawCubeVert[faceIndex] = vertList[face->z - 1]->y;
faceIndex++;
drawCubeVert[faceIndex] = vertList[face->z - 1]->z;
faceIndex++;
}
}
/*
* draws the shaders to the screen
*/
void renderShader()
{
glUseProgram(sID);//use the shader program which was set in main
glBindVertexArray(vao);
glDrawArrays(GL_TRIANGLES, 0, numOfVertex);//use the first 3 verticies from position 0 to draw a triangle
glUseProgram(0);//unbind the shader program
}
void Display()
{
//clear the screen, set the perspective and the view mode
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
gluPerspective(45.0, 1.0, 1.0, 100.0);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//then render the shaders
renderShader();
//then swap the buffers
glutSwapBuffers();
glutPostRedisplay();
}
/*initialise the basic gl functions and read the obj file + set up the required faces from this*/
void initGL()
{
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glMatrixMode(GL_PROJECTION);
glOrtho(0.0, 2.0, 0.0, 2.0, -1.0, 1.0);
ReadOBJ();
genFaces();
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA);
glutInitWindowPosition(200, 50);
glutInitWindowSize(winXRes, winYRes);
glutCreateWindow("Oliver Chamberlain Graphics assignment 2 shaders example");
glewInit();
initGL();
//check if the glsl is available
if (GLEW_ARB_vertex_shader && GLEW_ARB_fragment_shader)
printf("Ready for GLSL\n");
else
{
printf("No GLSL support\n");
exit(1);
}
shaders();//create the shader programs
glutDisplayFunc(Display);
glutMainLoop();
return 0;
}
|
/*************************************************************
* > File Name : P1801.cpp
* > Author : Tony
* > Created Time : 2019年02月20日 星期三 15时57分24秒
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
int m, n, a[200010], b, r = 1;
priority_queue<int> LH;
priority_queue<int, vector<int>, greater<int> > SH;
int main()
{
scanf("%d %d", &m, &n);
for (int i = 1; i <= m; ++i)
scanf("%d", &a[i]);
for (int i = 1; i <= n; ++i)
{
scanf("%d", &b);
for (int j = r; j <= b; ++j)
{
LH.push(a[j]);
if (LH.size() == i)
{
SH.push(LH.top());
LH.pop();
}
}
r = b + 1;
printf("%d\n", SH.top());
LH.push(SH.top());
SH.pop();
}
return 0;
}
|
//
// Created by twome on 08/05/2020.
//
#ifndef GAMEOFLIFE_OPENGL_LABEL_H
#define GAMEOFLIFE_OPENGL_LABEL_H
#include <string>
#include "../base/TextComponent.h"
class Label : public TextComponent {
public:
explicit Label(const std::string &id);
void draw(Graphics &graphics) override;
void layout() override;
};
#endif //GAMEOFLIFE_OPENGL_LABEL_H
|
/*Given a sorted dictionary of an alien language having N words and k starting alphabets of standard dictionary the task is to complete the function which returns a string denoting the order of characters in the language.
Note: Many orders may be possible for a particular test case, thus you may return any valid order.
Examples:
Input: Dict[ ] = { "baa", "abcd", "abca", "cab", "cad" }, k = 4
Output: Function returns "bdac"
Here order of characters is 'b', 'd', 'a', 'c'
Note that words are sorted and in the given language "baa"
comes before "abcd", therefore 'b' is before 'a' in output.
Similarly we can find other orders.
Input: Dict[] = { "caa", "aaa", "aab" }, k = 3
Output: Function returns "cab"*/
#include <bits/stdc++.h>
using namespace std;
class Graph
{
int v;
set<int> adj[26];
public:
Graph(int V)
{
this->v = V;
//adj= new vector <set <int>>[V];
}
void addEdge(int u, int v)
{
adj[u].insert(v);
}
void printEdges()
{
for (int i = 0; i < v; ++i)
{
cout << "\n"
<< i << "..";
for (auto j = adj[i].begin(); j != adj[i].end(); ++j)
cout << *j << " ";
}
}
void topologicalSortRecursive(int v, vector<bool> &visited, stack<int> &s)
{
visited[v] = true;
for (auto i = adj[v].begin(); i != adj[v].end(); ++i)
{
if (!visited[*i])
topologicalSortRecursive(*i, visited, s);
}
s.push(v);
}
string topologicalSort()
{
stack<int> s;
vector<bool> visited(v, false);
for (int i = 0; i < v; ++i)
{
if (!visited[i])
topologicalSortRecursive(i, visited, s);
}
string str;
while (!s.empty())
{
str.push_back(s.top() + 'a');
// cout <<(char) (s.top()+'a');
s.pop();
}
return str;
}
};
string order(string dict[], int n, int k)
{
Graph g(k);
for (int i = 0; i < n - 1; ++i)
{
if (dict[i] != dict[j])
{
auto mis = mismatch(dict[i].begin(), dict[i].end(), dict[j].begin());
if (mis.first != dict[i].end() && mis.second != dict[i + 1].end())
g.addEdge(*mis.first - 'a', *mis.second - 'a');
// cout << *mis.first - 'a' << " " << *mis.second - 'a' << "..\n";
}
}
//g.printEdges();
return g.topologicalSort();
}
int main()
{
int t, n, k;
cin >> t;
while (t--)
{
cin >> n >> k;
string dict[n];
for (int i = 0; i < n; ++i)
cin >> dict[i];
cout << order(dict, n, k) << "\n";
}
}
|
/*
Copyright (c) 2005-2023, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the University of Oxford nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef CLASSISABSTRACT_HPP_
#define CLASSISABSTRACT_HPP_
/** @file
*
* This file defines 4 macros to assist with explicitly declaring
* to the Boost Serialization library when a class is abstract.
* The interface for doing this changed in Boost 1.36.0, hence this
* wrapper.
*
* The easy case is for a non-templated class. For example, if you
* have a class called AbstractClass, use
* CLASS_IS_ABSTRACT(AbstractClass)
*
* For classes templated over either 1 or 2 unsigned parameters, there
* are helper macros TEMPLATED_CLASS_IS_ABSTRACT_1_UNSIGNED and
* TEMPLATED_CLASS_IS_ABSTRACT_2_UNSIGNED. For example, with a class
* template<unsigned SPACE_DIM, unsigned ELEMENT_DIM>
* class AbstractTemplatedClass { ... };
* use
* TEMPLATED_CLASS_IS_ABSTRACT_2_UNSIGNED(AbstractTemplatedClass)
*
* For a general templated class, you have to do a little extra work.
* For example, with a class
* template<class C, unsigned U>
* class AbstractTemplatedClass { ... };
* use
* namespace boost {
* namespace serialization {
* template<class C, unsigned U>
* struct is_abstract<AbstractTemplatedClass<C, U> >
* TEMPLATED_CLASS_IS_ABSTRACT_DEFN
* template<class C, unsigned U>
* struct is_abstract<const AbstractTemplatedClass<C, U> >
* TEMPLATED_CLASS_IS_ABSTRACT_DEFN
* }}
*
* (see AbstractCardiacCellWithModifiers for an example of this last case).
*/
#include <boost/version.hpp>
#if BOOST_VERSION >= 103600
// In Boost since 1.36.0, we need to use assume_abstract...
#include <boost/serialization/assume_abstract.hpp>
/**
* Explicitly mark a non-templated class as being abstract
* (Boost 1.36 and later).
* @param T the class
*/
#define CLASS_IS_ABSTRACT(T) BOOST_SERIALIZATION_ASSUME_ABSTRACT(T)
/**
* Content of the is_abstract type to mark a templated class as abstract
* (Boost 1.36 and later).
*/
#define TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
: boost::true_type {};
#else
// In Boost before 1.36.0, we use is_abstract...
#include <boost/serialization/is_abstract.hpp>
/**
* Explicitly mark a non-templated class as being abstract
* (Boost 1.35 and earlier).
* @param T the class
*/
#define CLASS_IS_ABSTRACT(T) BOOST_IS_ABSTRACT(T)
/**
* Content of the is_abstract type to mark a templated class as abstract
* (Boost 1.35 and earlier).
*/
#define TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
{ \
typedef mpl::bool_<true> type; \
BOOST_STATIC_CONSTANT(bool, value = true); \
};
#endif // BOOST_VERSION >= 103600
/**
* Convenience macro to declare a class templated over a single unsigned
* as abstract.
* @param T the class
*/
#define TEMPLATED_CLASS_IS_ABSTRACT_1_UNSIGNED(T) \
namespace boost { \
namespace serialization { \
template<unsigned U> \
struct is_abstract<T<U> > \
TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
template<unsigned U> \
struct is_abstract<const T<U> > \
TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
}}
/**
* Convenience macro to declare a class templated over 2 unsigneds
* as abstract.
* @param T the class
*/
#define TEMPLATED_CLASS_IS_ABSTRACT_2_UNSIGNED(T) \
namespace boost { \
namespace serialization { \
template<unsigned U1, unsigned U2> \
struct is_abstract<T<U1, U2> > \
TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
template<unsigned U1, unsigned U2> \
struct is_abstract<const T<U1, U2> > \
TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
}}
/**
* Convenience macro to declare a class templated over 3 unsigneds
* as abstract.
* @param T the class
*/
#define TEMPLATED_CLASS_IS_ABSTRACT_3_UNSIGNED(T) \
namespace boost { \
namespace serialization { \
template<unsigned U1, unsigned U2, unsigned U3> \
struct is_abstract<T<U1, U2, U3> > \
TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
template<unsigned U1, unsigned U2, unsigned U3> \
struct is_abstract<const T<U1, U2, U3> > \
TEMPLATED_CLASS_IS_ABSTRACT_DEFN \
}}
#endif /*CLASSISABSTRACT_HPP_*/
|
#include <fstream>
#include <string>
#include <iostream>
#include <sstream>
#include <cstdlib>
using namespace std;
int main()
{
int *P_Bt, *P_Wt, *P_Tat, *P_At, *P_id;
float avg_wt=0.0, avg_tat=0.0;
ifstream file("Q2.txt");
string str;
int num, count=0, burst_time=0, min;
file >> num;
P_Bt = new int[num];
P_At = new int[num];
P_Wt = new int[num];
P_Tat = new int[num];
P_id = new int[num];
// initial P_id
for (int i=0;i<num;++i)
{
P_id[i] = i+1;
}
// load arrival time and burst time
while(!file.eof()){
for(int i=0;i<num;++i)
{
file >> str;
P_At[i] = atoi(str.c_str());
//cout << "Arrival " << i << ":" << P_At[i] << "\n";
}
for(int i=0;i<num;++i)
{
file >> str;
P_Bt[i] = atoi(str.c_str());
//cout << "Burst " << i << ":" << P_Bt[i] << "\n";
}
}
// Sorting According to Arrival Time
for(int i=0;i<num;i++)
{
for(int j=0;j<num;j++)
{
if (P_At[i] < P_At[j])
{
swap(P_id[i],P_id[j]);
swap(P_At[i],P_At[j]);
swap(P_Bt[i],P_Bt[j]);
}
else if (P_At[i] == P_At[j]) // deal with same arrival time problem
{
if (P_Bt[i] < P_Bt[j])
{
swap(P_id[i],P_id[j]);
swap(P_At[i],P_At[j]);
swap(P_Bt[i],P_Bt[j]);
}
}
}
}
//for (int i=0;i<num;++i)
//cout << P_id[i] << "\n";
/*Arranging the table according to Burst time,
Execution time and Arrival Time
Arrival time <= Execution time
*/
int k = 1;
for(int i=0;i<num;i++)
{
burst_time = burst_time + P_Bt[i];
min = P_Bt[k];
for (int j=k;j<num;++j)
{
if ((P_At[j] <= burst_time) && (P_Bt[j] < min))
{
swap(P_id[k],P_id[j]);
swap(P_At[k],P_At[j]);
swap(P_Bt[k],P_Bt[j]);
}
}
++k;
}
// Calculate for waiting time
P_Wt[0]=0;
int sum = 0;
int sum_wt = 0;
for(int i=1;i<num;i++)
{
sum=sum+P_Bt[i-1];
P_Wt[i]=sum-P_At[i];
sum_wt=sum_wt+P_Wt[i];
}
avg_wt = ((float)sum_wt/(float)num);
// Calculate for turnaround time
int sum_tat = 0;
for(int i=0;i<num;i++)
{
P_Tat[i] = P_Wt[i] + P_Bt[i];
sum_tat += P_Tat[i];
}
avg_tat = ((float)sum_tat/(float)num);
cout<<"Process\tWaiting Time\tTurnaround Time";
// sort by index
for(int i=0;i<num;i++)
{
for(int j=0;j<num;j++)
{
if (P_id[i] < P_id[j])
{
swap(P_id[i],P_id[j]);
swap(P_At[i],P_At[j]);
swap(P_Bt[i],P_Bt[j]);
swap(P_Wt[i],P_Wt[j]);
swap(P_Tat[i],P_Tat[j]);
}
}
}
for (int i=0;i<num;i++)
{
cout<<"\nP["<<i+1<<"]"<<"\t"<<P_Wt[i]<<"\t\t"<<P_Tat[i];
// cout<<"\n"<<P_id[i]<<"\t"<<P_Wt[i]<<"\t\t"<<P_Tat[i];
}
cout<<"\n\nAverage Waiting Time:"<<avg_wt;
cout<<"\nAverage Turnaround Time:"<<avg_tat<<"\n";
return 0;
}
|
#include "Newton.h"
#include "iostream"
#include "vector"
#include "map"
using namespace std;
void Newton::init() {
double argument, value;
while (cin >> argument >> value) {
this->points.push_back(make_pair(argument, value));
}
table = new double* [points.size() + 1];
for (int i = 0; i < points.size() + 1; i++) {
table[i] = new double[points.size() + 1];
}
vector<pair<double, double> >::iterator iter;
int index = 0;
for (iter = points.begin(); iter < points.end(); iter++) {
table[0][index] = (iter->first);
table[1][index] = iter->second;
index++;
}
index = 1;
for (int i = 2; i < points.size() + 1; i++) {
for (int j = index; j < points.size(); j++) {
table[i][j] = (table[i - 1][j] - table[i - 1][j - 1]) /
(table[0][j] - table[0][j - 1 - (i - 2)]);
}
index += 1;
}
}
void Newton::init1() {
stage = 12;
points.push_back(make_pair(0, 5));
points.push_back(make_pair(10, 1));
points.push_back(make_pair(20, 7.5));
points.push_back(make_pair(30, 3));
points.push_back(make_pair(40, 4.5));
points.push_back(make_pair(50, 8.8));
points.push_back(make_pair(60, 15.5));
points.push_back(make_pair(70, 6.5));
points.push_back(make_pair(80, -5));
points.push_back(make_pair(90, -10));
points.push_back(make_pair(100, -2));
points.push_back(make_pair(110, 4.5));
points.push_back(make_pair(120, 7));
table = new double* [points.size() + 1];
for (int i = 0; i < points.size() + 1; i++) {
table[i] = new double[points.size() + 1];
}
vector<pair<double, double> >::iterator iter;
int index = 0;
for (iter = points.begin(); iter < points.end(); iter++) {
table[0][index] = (iter->first);
table[1][index] = iter->second;
index++;
}
index = 1;
for (int i = 2; i < points.size() + 1; i++) {
for (int j = index; j < points.size(); j++) {
table[i][j] = (table[i - 1][j] - table[i - 1][j - 1]) /
(table[0][j] - table[0][j - 1 - (i - 2)]);
}
index += 1;
}
}
double Newton::estimate(double x) {
double ret=0;
for (int i = 0; i < points.size(); i++) {
double back=1;
for (int j = 0; j < i; j++) {
back *= (x - points.at(j).first);
}
double a = chashang(i);
ret += back * chashang(i);
}
return ret;
}
double Newton::chashang( int stage) {
return table[stage+1][stage];
}
/*
extern "C" {
Newton n;
void init_n() {
n.init1();
}
void init_1() {
n.init();
}
double esti_n(double x) {
return n.estimate(x);
}
}*/
|
/*
Copyright (c) 2011 Andrew Wall
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 "TableFormatting.h"
#include <numeric>
#include <algorithm>
namespace gppUnit {
void insertTabs(TableFormatter& table, size_t size) {
for(size_t i = 0; i < size; ++i) {
table << tab;
}
}
TableFormatter::TableFormatter(): prevPages(), page(), summarySizes(), line(), lineIsEmpty(true) {}
void TableFormatter::tab() {
line.tab();
}
void TableFormatter::endLine() {
page.push_back(line);
clearLine();
}
void TableFormatter::clearLine() {
line.clear();
lineIsEmpty = true;
}
namespace TableFunctors {
struct NewLines {
std::string operator()(const std::string& init, const std::string& item)const {
return init + item + "\n";
}
};
struct Update {
explicit Update(std::vector<size_t>& sizes): sizes(sizes) {}
std::vector<size_t>& sizes;
void operator()(const TableLine& line) { line.update(sizes); }
};
struct Accumulator {
explicit Accumulator(const std::vector<size_t>& sizes): result(), sizes(sizes) {}
std::vector<std::string> result;
std::vector<size_t> sizes;
void operator()(const TableLine& line) { result.push_back(line.toString(sizes)); }
};
struct UpdateTable {
explicit UpdateTable(TableFormatter* table): table(table),
size(table->indentSize()),
firstLine((table->lineSize() > 0))
{}
TableFormatter* table;
size_t size;
bool firstLine;
template<typename ARG>
void operator()(const ARG& line) {
using gppUnit::tab;
if(firstLine) {
firstLine = false;
} else {
insertTabs(*table, size);
}
(*table) << line << endl;
}
};
struct PatchTable {
explicit PatchTable(TableFormatter* table): table(table) {}
TableFormatter* table;
template<typename ARG>
void operator()(const ARG& line) {
(*table) << line << endl;
}
};
}
std::vector<std::string> TableFormatter::partialVector(std::vector<size_t>& sizes) const {
TableFunctors::Update update = std::for_each(page.begin(), page.end(), TableFunctors::Update(sizes));
if(!lineIsEmpty) { line.update(update.sizes); }
return std::for_each(page.begin(), page.end(), TableFunctors::Accumulator(update.sizes)).result;
}
void TableFormatter::streamSpareLine(const TableLine& line, size_t prevPagesSize, size_t pageSize) {
if(!line.isEmpty()) {
if((indentSize() > 0) && ((prevPagesSize > 0) || (pageSize > 0))) {
insertTabs(*this, indentSize());
}
(*this) << line;
endLine();
}
}
TableFormatter& TableFormatter::operator<<(const TableFormatter& table) {
// Move page into prevPages
std::vector<std::string> result = partialVector(summarySizes);
std::copy(result.begin(), result.end(), back_inserter(prevPages));
page.clear();
// Limit summarySizes to line.size()
size_t lsize = line.size();
size_t ssize = summarySizes.size();
if(ssize > lsize) {
summarySizes.resize(lsize);
}
std::for_each(table.prevPages.begin(), table.prevPages.end(), TableFunctors::UpdateTable(this));
std::for_each(table.page.begin(), table.page.end(), TableFunctors::UpdateTable(this));
streamSpareLine(table.line, table.prevPages.size(), table.page.size());
return *this;
}
TableFormatter& TableFormatter::patch(const TableFormatter& table) {
std::for_each(table.prevPages.begin(), table.prevPages.end(), TableFunctors::PatchTable(this));
std::for_each(table.page.begin(), table.page.end(), TableFunctors::PatchTable(this));
if(!table.line.isEmpty()) {
(*this) << table.line;
endLine();
}
return *this;
}
std::vector<std::string> TableFormatter::toVector() const {
std::vector<size_t> sizes = summarySizes;
std::vector<std::string> result = partialVector(sizes);
// TODO: this is the same as Accumulator. Refactor?
if(!lineIsEmpty) { result.push_back(line.toString(sizes)); }
std::vector<std::string> allLines;
std::copy(prevPages.begin(), prevPages.end(), back_inserter(allLines));
std::copy(result.begin(), result.end(), back_inserter(allLines));
return allLines;
}
std::string TableFormatter::toString() const {
std::vector<std::string> asVector = toVector();
return std::accumulate(asVector.begin(), asVector.end(), std::string(), TableFunctors::NewLines());
}
}
|
#include <gtest/gtest.h>
#include "hypercube.hpp"
typedef uint8_t byte;
TEST(Hypercube, DefaultConstructorDim1) { Hypercube<byte, 1> h; }
TEST(Hypercube, DefaultConstructorDim2) { Hypercube<byte, 2> h; }
TEST(Hypercube, DefaultConstructorDim3) { Hypercube<byte, 3> h; }
TEST(Hypercube, DefaultConstructorDim4) { Hypercube<byte, 4> h; }
TEST(Hypercube, DefaultConstructorDim5) { Hypercube<byte, 5> h; }
TEST(Hypercube, DefaultConstructorDim6) { Hypercube<byte, 6> h; }
// Memory consumption increases exponentially - with Vector default size 16 a
// Hypercube<byte, 6> is ~16 MB and <byte, 7> is ~260 MB
TEST(Hypercube, SizeConstructorDim1) { Hypercube<byte, 1> h(3); }
TEST(Hypercube, SizeConstructorDim2) { Hypercube<byte, 2> h(3); }
TEST(Hypercube, SizeConstructorDim3) { Hypercube<byte, 3> h(3); }
TEST(Hypercube, IsAHypercube) {
const size_t dim = 3, size = 5;
Hypercube<byte, dim> h(size);
for(size_t i = 0; i < size; ++i) {
for(size_t j = 0; j < size; ++j) {
for(size_t k = 0; k < size; ++k) {
EXPECT_EQ(0, h[i][j][k]);
EXPECT_THROW({
h[-1][j][k];
}, std::out_of_range);
EXPECT_THROW({
h[i][-1][k];
}, std::out_of_range);
EXPECT_THROW({
h[i][j][-1];
}, std::out_of_range);
EXPECT_THROW({
h[size][j][k];
}, std::out_of_range);
EXPECT_THROW({
h[i][size][k];
}, std::out_of_range);
EXPECT_THROW({
h[i][j][size];
}, std::out_of_range);
}
}
}
}
TEST(Hypercube, IndexOperatorAssignmentWorks) {
Hypercube<byte, 3> h(5);
h[1][2][3] = 127;
h[3][1][2] = 128;
h[2][3][1] = 129;
EXPECT_EQ(127, h[1][2][3]);
EXPECT_EQ(128, h[3][1][2]);
EXPECT_EQ(129, h[2][3][1]);
}
TEST(Hypercube, PartialAssignment) {
// Copied from lab instructions
Hypercube<int, 3> n(7); // kub med 7*7*7 element
Hypercube<int, 6> m(5); // sex dimensioner, 5*5*...*5 element
m[1][3][2][1][4][0] = 7;
Hypercube<int, 3> t(5);
t = m[1][3][2]; // tilldela med del av m
t[1][4][0] = 2; // ändra t, ändra inte m
EXPECT_EQ(7, m[1][3][2][1][4][0]);
EXPECT_EQ(2, t[1][4][0]);
}
|
// Copyright 2021 The Google Research Authors.
//
// 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 "misc/misc_render.h"
#include <vector>
#include "base/dominance.h"
#include "base/zebraix_graph.proto.h"
#include "misc/misc_proto.h"
using zebraix::base::DominanceNode;
using zebraix::misc::AnchorToOctant;
using zebraix::misc::CompassToOctant;
namespace zebraix {
namespace misc {
void ApplyNodeLogic(const std::vector<DominanceNode>& d_nodes,
const zebraix_proto::Layout& proto_layout,
std::vector<zebraix_proto::Node>* target_nodes) {
const int node_count = target_nodes->size();
for (int p = 0; p < node_count; ++p) {
zebraix_proto::Node* p_node = &(*target_nodes)[p];
if (p_node->display() == zebraix_proto::SHOW_HIDE_AUTO) {
p_node->set_display(zebraix_proto::SHOW);
}
}
for (int p = 0; p < node_count; ++p) {
zebraix_proto::Node* p_node = &(*target_nodes)[p];
if (p_node->display() == zebraix_proto::SHOW_HIDE_AUTO) {
p_node->set_display(zebraix_proto::SHOW);
}
if (p_node->anchor() == zebraix_proto::ANCHOR_AUTO) {
int child_count = 0;
int parent_count = 0;
for (const auto child : d_nodes[p].children) {
if ((*target_nodes)[child].display() != zebraix_proto::HIDE) {
++child_count;
}
}
for (const auto parent : d_nodes[p].parents) {
if ((*target_nodes)[parent].display() != zebraix_proto::HIDE) {
++parent_count;
}
}
zebraix_proto::LabelAnchor anchor =
child_count == parent_count
? zebraix_proto::BR
: (child_count > parent_count
? (parent_count == 0 ? zebraix_proto::R
: zebraix_proto::BR)
: (child_count == 0 ? zebraix_proto::BL
: zebraix_proto::BL));
p_node->set_anchor(OctantToAnchor(
AnchorToOctant(anchor) + CompassToOctant(proto_layout.direction())));
}
if (p_node->compass() == zebraix_proto::DIRECTION_AUTO) {
p_node->set_compass(
OctantToCompass(AnchorToOctant(p_node->anchor()) + 4));
}
}
}
} // namespace misc
} // namespace zebraix
|
/*
========================================================================
Name : d_traceredirect.h
Author : DH
Copyright : All right is reserved!
Version :
E-Mail : dh.come@gmail.com
Description :
Copyright (c) 2009-2015 DH.
This material, including documentation and any related
computer programs, is protected by copyright controlled BY Du Hui(DH)
========================================================================
*/
#ifndef __D_TRACEREDIRECT_H__
#define __D_TRACEREDIRECT_H__
#include <e32cmn.h>
#ifndef __KERNEL_MODE__
#include <e32std.h>
#endif
class TCapsTestV01
{
public:
TVersion iVersion;
};
class RTraceRedirect : public RBusLogicalChannel
{
public:
enum TControl
{};
enum TRequest
{
ERequestReadTrace = 0x01,
ERequestReadCancel = 0x02,
};
public:
#ifndef __KERNEL_MODE__
inline TInt Open();
inline TInt Read( TRequestStatus& aStatus, TDes8 &aDes, TInt aLength );
inline void CancelRead();
#endif
};
#ifndef __KERNEL_MODE__
inline TInt RTraceRedirect::Open()
{
return DoCreate( _L("TRACEREDIRECTION"), TVersion(0, 1, 1), KNullUnit, NULL, NULL );
}
inline TInt RTraceRedirect::Read( TRequestStatus& aStatus, TDes8 &aDes, TInt aMaxLength )
{
DoRequest( ERequestReadTrace, aStatus, (TAny *)&aDes, (TAny *)aMaxLength );
return KErrNone;
}
inline void RTraceRedirect::CancelRead()
{
return DoCancel( ERequestReadCancel );
}
#endif
#endif
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.